home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Periodicals / CSMP / C.S.M.P. Digest, Issue 3.018 < prev    next >
Internet Message Format  |  1994-06-09  |  87KB

  1. From: pottier@clipper.ens.fr (Francois Pottier)
  2. Subject: csmp-digest-v3-018
  3. Date: Fri, 22 Apr 94 12:17:36 MET DST
  4.  
  5. C.S.M.P. Digest             Fri, 22 Apr 94       Volume 3 : Issue 18
  6.  
  7. Today's Topics:
  8.  
  9.         CD-ROM of Mac source code?
  10.         Color Quickdraw Intimcay
  11.         Custom popup menu
  12.         Editable pop-up menus
  13.         Females who answer questions?
  14.         HELP - PICT File ColorTables and Palettes
  15.         Max # of open files
  16.         Proper QT PICT creation?
  17.         Q: Changing font & size of dialog items
  18.         Removing PowerPC code from a fat binary
  19.         Roman Numerals
  20.         SCSI Drivers
  21.  
  22.  
  23.  
  24. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  25. (pottier@clipper.ens.fr).
  26.  
  27. The digest is a collection of article threads from the internet newsgroup
  28. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  29. regularly and want an archive of the discussions.  If you don't know what a
  30. newsgroup is, you probably don't have access to it.  Ask your systems
  31. administrator(s) for details.  If you don't have access to news, you may
  32. still be able to post messages to the group by using a mail server like
  33. anon.penet.fi (mail help@anon.penet.fi for more information).
  34.  
  35. Each issue of the digest contains one or more sets of articles (called
  36. threads), with each set corresponding to a 'discussion' of a particular
  37. subject.  The articles are not edited; all articles included in this digest
  38. are in their original posted form (as received by our news server at
  39. nef.ens.fr).  Article threads are not added to the digest until the last
  40. article added to the thread is at least two weeks old (this is to ensure that
  41. the thread is dead before adding it to the digest).  Article threads that
  42. consist of only one message are generally not included in the digest.
  43.  
  44. The digest is officially distributed by two means, by email and ftp.
  45.  
  46. If you want to receive the digest by mail, send email to listserv@ens.fr
  47. with no subject and one of the following commands as body:
  48.     help                        Sends you a summary of commands
  49.     subscribe csmp-digest Your Name    Adds you to the mailing list
  50.     signoff csmp-digest            Removes you from the list
  51. Once you have subscribed, you will automatically receive each new
  52. issue as it is created.
  53.  
  54. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  55. Questions related to the ftp site should be directed to
  56. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  57. digest are available there.
  58.  
  59. Also, the digests are available to WAIS users as comp.sys.mac.programmer.src.
  60.  
  61.  
  62. -------------------------------------------------------
  63.  
  64. >From celestin@pt.olympus.net (Paul Celestin)
  65. Subject: CD-ROM of Mac source code?
  66. Date: 5 Apr 1994 21:39:46 GMT
  67. Organization: Celestin Company
  68.  
  69. Does anyone know of a CD-ROM of Mac source code? I know there are plenty of
  70. sites on the Internet with source code, but has anyone compiled it all into
  71. one CD-ROM? If not, are there any people interested in something like this?
  72. If it's not available, I might do it myself.
  73.  
  74. Thanks for all replies.
  75. -- 
  76. celestin@pt.olympus.net              (Paul Celestin, Celestin Company)
  77. Check out my URL:   file://speedway.net/pub/celestin/www/Celestin.html
  78.  
  79. +++++++++++++++++++++++++++
  80.  
  81. >From blob@apple.com (Brian Bechtel)
  82. Date: 7 Apr 1994 22:57:04 -0700
  83. Organization: Apple Computer, Inc., Cupertino, California
  84.  
  85. celestin@pt.olympus.net (Paul Celestin) writes:
  86.  
  87. >Does anyone know of a CD-ROM of Mac source code? I know there are plenty of
  88. >sites on the Internet with source code, but has anyone compiled it all into
  89. >one CD-ROM? If not, are there any people interested in something like this?
  90. >If it's not available, I might do it myself.
  91.  
  92. MacTech Journal sells a CD-ROM with all the source code and articles
  93. they've ever published.
  94.  
  95. Wayzata publishes Disc Tracy, which is a collection of Macintosh source
  96. code on CD-ROM.  Wayzata is in the metropolitan Minneapolis Minnesota
  97. area.
  98.  
  99. --Brian Bechtel     blob@apple.com     "My opinion, not Apple's"
  100.  
  101. +++++++++++++++++++++++++++
  102.  
  103. >From Rand_Arnold@blt.berkeley.ca.us (Rand Arnold)
  104. Date: Fri,  8 Apr 94 17:24:17 PST
  105. Organization: Berkeley Learning Technologies, Inc.
  106.  
  107. Paul Celestin writes:
  108.  
  109. >>Does anyone know of a CD-ROM of Mac source code? I know there are plenty of
  110. >>sites on the Internet with source code, but has anyone compiled it all into
  111. >>one CD-ROM? If not, are there any people interested in something like this?
  112. >>If it's not available, I might do it myself.
  113.  
  114.  
  115. Xplain Corporation sells a CD-ROM that contains all of the source code from the
  116. last eight years of MacTutor/MacTech magazine. It can be quite a resource.
  117. Xplain can be reached at custservice@xplain.com or info@xplain.com, voice (310)
  118. 575-4343.
  119.  
  120. Rand
  121. Berkeley Learning Technologies, Inc.                           (510) 540-5963
  122.  
  123. ---------------------------
  124.  
  125. >From veenkerb@seq.oit.osshe.edu (Brian Veenker)
  126. Subject: Color Quickdraw Intimcay
  127. Date: 1 Apr 1994 13:00:57 -0600
  128. Organization: UTexas Mail-to-News Gateway
  129.  
  130. Crud. So GWorlds don't work on non-Color Quickdraw machines. One user 
  131. suggested that I just leave my data in some native format and just draw 
  132. it as I go. I want this prog to run on everything, but that sounds like a 
  133. huge pain in the butt.. Especially since I probably won't be able to work 
  134. on it on my PB100 now...
  135.  
  136. WAIT a minute, I just copied the thing over (to my PB100), and it woiks! 
  137. Groovy! I'm back in business! Thanks everyone!
  138.  
  139. BTW: does it make any difference that I'm only using a 1-bit depth in my 
  140. GWorld? Could that have helped? Or is it that my PB100 just happens to be 
  141. running Color Quickdraw?
  142.  
  143. Thanks again everybody!
  144. Brian Veenker
  145.  
  146.  
  147.  
  148. +++++++++++++++++++++++++++
  149.  
  150. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  151. Date: 5 Apr 94 12:43:02 +1300
  152. Organization: University of Waikato, Hamilton, New Zealand
  153.  
  154. In article <Pine.3.88.9404011059.A20930-0100000@seq.oit.osshe.edu>, veenkerb@seq.oit.osshe.edu (Brian Veenker) writes:
  155. > Crud. So GWorlds don't work on non-Color Quickdraw machines. One user
  156. > suggested that I just leave my data in some native format and just draw
  157. > it as I go. I want this prog to run on everything, but that sounds like a
  158. > huge pain in the butt.. Especially since I probably won't be able to work
  159. > on it on my PB100 now...
  160. >
  161. > WAIT a minute, I just copied the thing over (to my PB100), and it woiks!
  162. > Groovy! I'm back in business! Thanks everyone!
  163. >
  164. > BTW: does it make any difference that I'm only using a 1-bit depth in my
  165. > GWorld? Could that have helped? Or is it that my PB100 just happens to be
  166. > running Color Quickdraw?
  167.  
  168. Your PB100 does not have Color QuickDraw. However, under System 7, even
  169. non-Color-QuickDraw machines have GWorlds, albeit limited to 1 bit per pixel,
  170. as you were using.
  171.  
  172. IM6 has a list somewhere of the Color QuickDraw calls you're allowed to make
  173. on a non-Color-QuickDraw machine under System 7.
  174.  
  175. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  176. Info & Tech Services Division              fax: +64-7-838-4066
  177. University of Waikato            electric mail: ldo@waikato.ac.nz
  178. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  179.  
  180. +++++++++++++++++++++++++++
  181.  
  182. >From Ron_Hunsinger@bmug.org (Ron Hunsinger)
  183. Date: Sun,  3 Apr 94 19:56:38 PST
  184. Organization: Berkeley Macintosh Users Group
  185.  
  186. veenkerb@seq.oit.osshe.edu (Brian Veenker) writes:
  187.  
  188. >Crud. So GWorlds don't work on non-Color Quickdraw machines. One user 
  189. >suggested that I just leave my data in some native format and just draw 
  190. >it as I go. I want this prog to run on everything, but that sounds like a 
  191. >huge pain in the butt.. Especially since I probably won't be able to work 
  192. >on it on my PB100 now...
  193. >
  194. >WAIT a minute, I just copied the thing over (to my PB100), and it woiks! 
  195. >Groovy! I'm back in business! Thanks everyone!
  196. >
  197. >BTW: does it make any difference that I'm only using a 1-bit depth in my 
  198. >GWorld? Could that have helped? Or is it that my PB100 just happens to be 
  199. >running Color Quickdraw?
  200.  
  201. Don't confuse "Color Quickdraw" with "monitor is displaying color".
  202. "Color Quickdraw" means that you have the version of Quickdraw that 
  203. understands what color is.  It doesn't necessarily mean that you have
  204. your monitor(s) set to display color, or even that you have a color-
  205. capable monitor.
  206.  
  207. Color Quickdraw is in the ROMS of Mac II and later machines, and is also
  208. in System 7 or later.  So you can probably depend on color QD and still
  209. run on almost everything.  You will be locking out only SE and earlier
  210. machines running on 6.0.8 and earlier, and I think even for those machines 
  211. there may be an INIT that will supply color QD.  For that matter, if you
  212. are using GWorlds, you are already depending on Sys7, so you should have
  213. color QD already.  Of course, the noble thing would be to check anyway...
  214.  
  215. -Ron Hunsinger
  216.  
  217. +++++++++++++++++++++++++++
  218.  
  219. >From Carl R. Osterwald <carl_osterwald@nrel.gov>
  220. Date: Wed, 6 Apr 94 16:08:32 GMT
  221. Organization: National Renewable Energy Laboratory
  222.  
  223. In article <001343F1.fc@bmug.org> Ron Hunsinger, Ron_Hunsinger@bmug.org
  224. writes:
  225. >Color Quickdraw is in the ROMS of Mac II and later machines, and is also
  226. >in System 7 or later.  So you can probably depend on color QD and still
  227. >run on almost everything.  You will be locking out only SE and earlier
  228. >machines running on 6.0.8 and earlier, and I think even for those
  229. machines 
  230. >there may be an INIT that will supply color QD.  For that matter, if you
  231. >are using GWorlds, you are already depending on Sys7, so you should have
  232. >color QD already.  Of course, the noble thing would be to check anyway...
  233.  
  234. This is not entirely true, Color QD will not run on 68000 Macs, not even
  235. with the prism INIT.  Many of the Color QD routines are written in 68020
  236. assembler.  One of the Tech Notes explains this.
  237.  
  238. +++++++++++++++++++++++++++
  239.  
  240. >From gdl@stlawrence.maths (Greg Landweber)
  241. Date: 08 Apr 1994 11:37:03 GMT
  242. Organization: (none)
  243.  
  244. In article <001343F1.fc@bmug.org> Ron_Hunsinger@bmug.org (Ron Hunsinger) writes:
  245.    Color Quickdraw is in the ROMS of Mac II and later machines, and is also
  246.    in System 7 or later.  So you can probably depend on color QD and still
  247.    run on almost everything.  You will be locking out only SE and earlier
  248.    machines running on 6.0.8 and earlier, and I think even for those machines 
  249.    there may be an INIT that will supply color QD.  For that matter, if you
  250.    are using GWorlds, you are already depending on Sys7, so you should have
  251.    color QD already.  Of course, the noble thing would be to check anyway...
  252.  
  253. This is NOT true.  Color Quickdraw is optimized for use with a 68020
  254. processor or better, and it will NOT run on any machine with a 68000.
  255. System 7 contains an updated version of 32-bit QuickDraw, but that is
  256. useless on machines like the Plus, SE, Classic, Portable, PB100.
  257.  
  258. -- Greg "Browser" Landweber
  259.  
  260. ---------------------------
  261.  
  262. >From ping@genie.demon.co.uk ("K.H.Ping")
  263. Subject: Custom popup menu
  264. Date: Fri, 8 Apr 1994 15:59:42 +0000
  265. Organization: Associated Newspapers
  266.  
  267. Hi,
  268.  
  269. can anyone tell me how to do a popup menu (with no popup box) that is 
  270. attached to a window bar (like the one that appears if you hold down the 
  271. option key and click in the title bar of a window under THINK C 6.0)? 
  272.  
  273. +++++++++++++++++++++++++++
  274.  
  275. >From petm@soda.berkeley.edu (Peter Mattis)
  276. Date: 8 Apr 1994 20:22:53 GMT
  277. Organization: Computer Science Undergrad Assoc., UCBerkeley
  278.  
  279. In article <765849410snx@genie.demon.co.uk>,
  280. K.H.Ping <ping@genie.demon.co.uk> wrote:
  281. >Hi,
  282. >
  283. >can anyone tell me how to do a popup menu (with no popup box) that is 
  284. >attached to a window bar (like the one that appears if you hold down the 
  285. >option key and click in the title bar of a window under THINK C 6.0)? 
  286.  
  287. Well, since the application (you) draws the popup box then if you
  288. don't want one then don't draw it.
  289.  
  290. To do a popup like the one in THINK C 6.0 all you have to do is
  291. call PopUpMenuSelect(myMenu, vPosition, hPostion, lastItem)
  292.  
  293. -myMenu is the MenuHandle to your menu
  294. -vPosition is the vertical position of the mouse click.
  295.  (you can adjust this value so that the popup doesn't appear
  296.   below and to the right of the cursor always like it does in 
  297.   THINK)
  298. -hPosition is the horizontal position of the mouse click.
  299.  (you can adjust this value just like vPosition)
  300. -lastItem is the number of the last item selected. But since
  301.  there is no "last item" because you don't have a popup box then
  302.  this value should be 1.
  303.  
  304. Oh, and you call PopUpMenuSelect whenever you determine there has
  305. been an option-click in the title bar of your window.
  306.  
  307. -Peter Mattis
  308.  
  309.  
  310. ---------------------------
  311.  
  312. >From molly@i-link.com (Molly Gilmore Baldwin)
  313. Subject: Editable pop-up menus
  314. Date: 6 Apr 1994 03:51:34 GMT
  315. Organization: I-Link, Ltd., Des Moines, Iowa, US - 515/255-2754
  316.  
  317. I'd like to set up a pop-up menu that people could also type a value in
  318. for.  The most common example of what I'm trying to do would be a point
  319. size pop-up, in which you get to pick the common point sizes in 6-point
  320. increments, but where you could also just type in 17.
  321.  
  322. Does anyone know of some good examples of how to do this? 
  323.  
  324. +++++++++++++++++++++++++++
  325.  
  326. >From pcastine@jake.prz.tu-berlin.de (Peter Castine)
  327. Date: Wed, 6 Apr 1994 19:24:31 GMT
  328. Organization: PRZ TU-Berlin
  329.  
  330. molly@i-link.com (Molly Gilmore Baldwin) writes:
  331. >I'd like to set up a pop-up menu that people could also type a value in
  332. >for.  The most common example of what I'm trying to do would be a point
  333. >size pop-up, in which you get to pick the common point sizes in 6-point
  334. >increments, but where you could also just type in 17.
  335. >
  336. >Does anyone know of some good examples of how to do this? 
  337.  
  338. There are detailed examples of what this should look like in _Inside
  339. Macintsoh VI_, see Figures 2-30 and 2-31 in the User Interface
  340. chapter. I'm sure the examples are in _NIM_, but I don't have it,
  341. so I can't tell you where to look.
  342.  
  343. Implementation is pretty straight-forward when you see the examples.
  344. hope this pointer gets you on the right track...
  345. -- 
  346. Peter Castine                      | One child is shot every two hours
  347. pcastine@jake.kgw.tu-berlin.de     | in the U.S.A.
  348.                    | Thank you for blocking gun control,
  349.                    | N.R.A.
  350.  
  351. +++++++++++++++++++++++++++
  352.  
  353. >From ari@world.std.com (Ari I Halberstadt)
  354. Date: Thu, 7 Apr 1994 00:21:43 GMT
  355. Organization: The World Public Access UNIX, Brookline, MA
  356.  
  357. In article <molly-050494225023@ts1-3.i-link.com>,
  358. Molly Gilmore Baldwin <molly@i-link.com> wrote:
  359. >I'd like to set up a pop-up menu that people could also type a value in
  360. >for.  The most common example of what I'm trying to do would be a point
  361. >size pop-up, in which you get to pick the common point sizes in 6-point
  362. >increments, but where you could also just type in 17.
  363. >
  364. >Does anyone know of some good examples of how to do this? 
  365.  
  366. You can use my Popup CDEF. I just sent the current version (1.0b3) to
  367. the info-mac archives and it should be available there in the
  368. /info-mac/dev/src directory within a few days. It was also posted a
  369. few weeks ago to alt.sources.mac and is available in the file
  370.  
  371. ftpbio.bgsu.edu:/ftp/pub/alt.sources.mac/popupcdef1.0b3.cpt.hqx
  372.  
  373. The file "PopupCDEF-demo.c" contains sample code that shows how a font
  374. size type-in popup menu can be managed.
  375. -- 
  376. Ari Halberstadt    ari@world.std.com     #include <std/disclaimer.h>
  377. "These beetles were long considered to be very rare because very few
  378. entomologists look for beetles in the mountains, in winter, at night,
  379. during snow storms." -- Purves W. K., et al, "Life: The Science of
  380.  
  381. ---------------------------
  382.  
  383. >From susanlesch@aol.com (SusanLesch)
  384. Subject: Females who answer questions?
  385. Date: 18 Mar 1994 04:52:04 -0500
  386. Organization: America Online, Inc. (1-800-827-6364)
  387.  
  388. Informal survey
  389.   In your own experience, how many females regularly answer
  390.   programming and technical questions in this newsgroup? I
  391.   mean women who often answer (rather than ask) questions
  392.   about programming (or, failing that, anything you would
  393.   term "technical").
  394.  
  395.   As determined informally in 1993 by a source I cannot
  396.   reveal, there were approximately two qualifiers in
  397.   Macintosh programming on the entire Internet. As
  398.   determined by myself, through logging CompuServe's
  399.   Macintosh Developers' Forums, I found about two also.
  400.   (Just a note that CIS' name fields allow full names,
  401.   unlike AOL and other online services who have only 10
  402.   available characters, which seems to lead to ambiguity in
  403.   gender by name.)
  404.  
  405.   I do not mean to suggest that these 1000:1? ratios
  406.   reflect all working programmers! I am curious to know if
  407.   my source re: the Internet was being facetious or rather,
  408.   as I tend to suspect, being fairly accurate.
  409.  
  410. Thanks very much for any replies,
  411. Susan Lesch
  412. (an Internet and C novice)
  413. P.S. Pardon the multiple postings, my mistake.
  414.  
  415. +++++++++++++++++++++++++++
  416.  
  417. >From wdh@netcom.com (Bill Hofmann)
  418. Date: Fri, 18 Mar 1994 18:36:49 GMT
  419. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  420.  
  421. susanlesch@aol.com (SusanLesch) writes:
  422. >Informal survey
  423. >  In your own experience, how many females regularly answer
  424. >  programming and technical questions in this newsgroup? I
  425. >  mean women who often answer (rather than ask) questions
  426. >  about programming (or, failing that, anything you would
  427. >  term "technical").
  428. Not many, but I think probably a larger percentage than are distributed
  429. amongst the developer community as a whole.  My experience with teaching
  430. gobs of Apple and non-Apple developers is that *at this point* many of
  431. the senior software types are still men, reflecting mostly a generational
  432. lag in women's participation in the field.  After all, my class at MIT
  433. had about 15-20% women, so it isn't suprising that people my age who
  434. post are mostly men.  Plus fewer women seem to like to flame :->
  435. -- 
  436. -Bill Hofmann                    wdh@netcom.COM
  437.  Fresh Software and Instructional Design    +1 510 524 0852
  438.  
  439. +++++++++++++++++++++++++++
  440.  
  441. >From schiffer@dispair.stsci.edu (Francis H. Schiffer 3rd)
  442. Date: Fri, 18 Mar 1994 20:12:51 GMT
  443. Organization: Self
  444.  
  445. In article <wdhCMvIDD.Dts@netcom.com>, wdh@netcom.com (Bill Hofmann) wrote:
  446.  
  447. > post are mostly men.  Plus fewer women seem to like to flame :->
  448.  
  449. That is my wife's analysis as to why there are so few women posting on many
  450. of the Usenet groups.  There are many more posts by women on email circles
  451. and/or Usenet groups where the flamage is minimal.
  452.          skip
  453. -- 
  454. Francis H Schiffer 3rd  schiffer@stsci.edu - my opinions only, those of
  455. skip@dispair.stsci.edu  stscic::schiffer   - my employer are unknown to me
  456.  
  457. +++++++++++++++++++++++++++
  458.  
  459. >From mikeh@kralizec.zeta.org.au (Michael Hore)
  460. Date: 26 Mar 1994 16:55:02 +1000
  461. Organization: Kralizec Dialup Unix Sydney: +61-2-837-1183 V.32bis
  462.  
  463.  
  464. susanlesch@aol.com (SusanLesch) writes:
  465.  
  466. >  In your own experience, how many females regularly answer
  467. >  programming and technical questions in this newsgroup? I
  468. >  mean women who often answer (rather than ask) questions
  469. >  about programming (or, failing that, anything you would
  470. >  term "technical").
  471. >
  472. >  As determined informally in 1993 by a source I cannot
  473. >  reveal, there were approximately two qualifiers in
  474. >  Macintosh programming on the entire Internet.
  475.  
  476. I've been reading c.s.m.p for a couple of years now, and I'd have to
  477. say that that's two more than I've ever noticed.
  478.  
  479. But I've been to a number of Mac developers' meetings here in
  480. Sydney, Australia, and the ratio there was more like 10:1.
  481.  
  482. My son is studying CS at university - I must check with him to see
  483. if the ratio is higher there, so that we could say that there's
  484. any sort of trend.
  485.  
  486. As another poster said, I suspect there's a reluctance to get involved
  487. in a Usenet group with all the flamage etc. that goes on.
  488.  
  489. [...snip...]
  490. >  I do not mean to suggest that these 1000:1? ratios
  491. >  reflect all working programmers! I am curious to know if
  492. >  my source re: the Internet was being facetious or rather,
  493. >  as I tend to suspect, being fairly accurate.
  494.  
  495. Looks accurate to me.
  496.  
  497. >Thanks very much for any replies,
  498. >Susan Lesch
  499. >(an Internet and C novice)
  500.  
  501. Welcome!
  502.  
  503. --  Mike.
  504.  
  505. - --------------------------------------------------------
  506. Mike Hore          mikeh@kralizec.zeta.org.au
  507. .sig deliberately kept short to minimize .sig/noise ratio.
  508. - --------------------------------------------------------
  509.  
  510. +++++++++++++++++++++++++++
  511.  
  512. >From lrucker@parcplace.com (Lee Ann Rucker)
  513. Date: 30 Mar 1994 22:16:00 GMT
  514. Organization: ParcPlace
  515.  
  516.  susanlesch@aol.com (SusanLesch) writes:
  517.  
  518.  >  In your own experience, how many females regularly answer
  519.  >  programming and technical questions in this newsgroup? I
  520.  >  mean women who often answer (rather than ask) questions
  521.  >  about programming (or, failing that, anything you would
  522.  >  term "technical").
  523.  >
  524.  
  525. I've answered a few questions.  I don't answer often, because questions
  526. generally fall into two categories: so simple that the answer's been posted
  527. before the question gets to my newsreader, or out of my area of expertise -
  528. I see very few questions about the internals of the Smalltalk Virtual
  529. Machine.
  530.  
  531. LeeAnn Rucker
  532. ParcPlace Systems
  533.  
  534. +++++++++++++++++++++++++++
  535.  
  536. >From sichase@csa5.lbl.gov (SCOTT I CHASE)
  537. Date: 31 Mar 1994 10:52 PST
  538. Organization: Lawrence Berkeley Laboratory - Berkeley, CA, USA
  539.  
  540. In article <lrucker-300394141641@leeann-mac.parcplace.com>, lrucker@parcplace.com (Lee Ann Rucker) writes...
  541. > susanlesch@aol.com (SusanLesch) writes:
  542. > >  In your own experience, how many females regularly answer
  543. > >  programming and technical questions in this newsgroup? I
  544. > >  mean women who often answer (rather than ask) questions
  545. > >  about programming (or, failing that, anything you would
  546. > >  term "technical").
  547. > >
  548. >I've answered a few questions.  I don't answer often, because questions
  549. >generally fall into two categories: so simple that the answer's been posted
  550. >before the question gets to my newsreader, or out of my area of expertise -
  551. >I see very few questions about the internals of the Smalltalk Virtual
  552. >Machine.
  553.  
  554. Ah, well that's the kicker.  Most men don't seem to let any of that stop
  555. them.  
  556.  
  557. -Scott
  558. - ------------------                         Physics is not a religion.  If
  559. Scott I. Chase                               it were, we'd have a much easier
  560. SICHASE@CSA2.LBL.GOV                         time raising money. -Leon Lederman
  561.  
  562. +++++++++++++++++++++++++++
  563.  
  564. >From mikeh@kralizec.zeta.org.au (Michael Hore)
  565. Date: 27 Mar 1994 12:56:33 +1000
  566. Organization: Kralizec Dialup Unix Sydney: +61-2-837-1183 V.32bis
  567.  
  568.  
  569. Yesterday I wrote:
  570.  
  571. >My son is studying CS at university - I must check with him to see
  572. >if the ratio is higher there, so that we could say that there's
  573. >any sort of trend.
  574.  
  575. He said it's about 10:1 there - but most of the 10% females are from
  576. a non English-speaking background (Asian).  So it's possible that
  577. lack of confidence in English is another factor operating here.
  578.  
  579. This percentage isn't very different from what I remember when I
  580. studied CS nearly 20 years ago, except that the females then were
  581. all from an English-speaking background.  So at least in this part
  582. of the world, if we think the ratio of females "ought" to be rising,
  583. for some reason, then we have a problem.  It just isn't happening.
  584.  
  585. I know this has gone beyond what the original poster asked, but
  586. interesting nonetheless.
  587.  
  588. --  Mike.
  589.  
  590. - --------------------------------------------------------
  591. Mike Hore          mikeh@kralizec.zeta.org.au
  592. .sig deliberately kept short to minimize .sig/noise ratio.
  593. - --------------------------------------------------------
  594.  
  595. +++++++++++++++++++++++++++
  596.  
  597. >From mikeh@kralizec.zeta.org.au (Michael Hore)
  598. Date: 29 Mar 1994 16:55:02 +1000
  599. Organization: Kralizec Dialup Unix Sydney: +61-2-837-1183 V.32bis
  600.  
  601.  
  602. susanlesch@aol.com (SusanLesch) writes:
  603.  
  604. >  In your own experience, how many females regularly answer
  605. >  programming and technical questions in this newsgroup? I
  606. >  mean women who often answer (rather than ask) questions
  607. >  about programming (or, failing that, anything you would
  608. >  term "technical").
  609. >
  610. >  As determined informally in 1993 by a source I cannot
  611. >  reveal, there were approximately two qualifiers in
  612. >  Macintosh programming on the entire Internet.
  613.  
  614. I've been reading c.s.m.p for a couple of years now, and I'd have to
  615. say that that's two more than I've ever noticed.
  616.  
  617. But I've been to a number of Mac developers' meetings here in
  618. Sydney, Australia, and the ratio there was more like 10:1.
  619.  
  620. My son is studying CS at university - I must check with him to see
  621. if the ratio is higher there, so that we could say that there's
  622. any sort of trend.
  623.  
  624. As another poster said, I suspect there's a reluctance to get involved
  625. in a Usenet group with all the flamage etc. that goes on.
  626.  
  627. [...snip...]
  628. >  I do not mean to suggest that these 1000:1? ratios
  629. >  reflect all working programmers! I am curious to know if
  630. >  my source re: the Internet was being facetious or rather,
  631. >  as I tend to suspect, being fairly accurate.
  632.  
  633. Looks accurate to me.
  634.  
  635. >Thanks very much for any replies,
  636. >Susan Lesch
  637. >(an Internet and C novice)
  638.  
  639. Welcome!
  640.  
  641. --  Mike.
  642.  
  643. - --------------------------------------------------------
  644. Mike Hore          mikeh@kralizec.zeta.org.au
  645. .sig deliberately kept short to minimize .sig/noise ratio.
  646. - --------------------------------------------------------
  647.  
  648. +++++++++++++++++++++++++++
  649.  
  650. >From mikeh@kralizec.zeta.org.au (Michael Hore)
  651. Date: 29 Mar 1994 12:56:33 +1000
  652. Organization: Kralizec Dialup Unix Sydney: +61-2-837-1183 V.32bis
  653.  
  654.  
  655. Yesterday I wrote:
  656.  
  657. >My son is studying CS at university - I must check with him to see
  658. >if the ratio is higher there, so that we could say that there's
  659. >any sort of trend.
  660.  
  661. He said it's about 10:1 there - but most of the 10% females are from
  662. a non English-speaking background (Asian).  So it's possible that
  663. lack of confidence in English is another factor operating here.
  664.  
  665. This percentage isn't very different from what I remember when I
  666. studied CS nearly 20 years ago, except that the females then were
  667. all from an English-speaking background.  So at least in this part
  668. of the world, if we think the ratio of females "ought" to be rising,
  669. for some reason, then we have a problem.  It just isn't happening.
  670.  
  671. I know this has gone beyond what the original poster asked, but
  672. interesting nonetheless.
  673.  
  674. --  Mike.
  675.  
  676. - --------------------------------------------------------
  677. Mike Hore          mikeh@kralizec.zeta.org.au
  678. .sig deliberately kept short to minimize .sig/noise ratio.
  679. - --------------------------------------------------------
  680.  
  681. +++++++++++++++++++++++++++
  682.  
  683. >From rba26@cas.org (Brad Andrews)
  684. Date: Fri, 8 Apr 1994 16:31:05 GMT
  685. Organization: Chemical Abstracts Service
  686.  
  687. In article 60l@kralizec.zeta.org.au, mikeh@kralizec.zeta.org.au (Michael Hore) writes:
  688. [snip]
  689. ]
  690. ]As another poster said, I suspect there's a reluctance to get involved
  691. ]in a Usenet group with all the flamage etc. that goes on.
  692. ]
  693. [snip]
  694.  
  695. I have been flamed quite a few times by women on other forums, so I doubt
  696. that is the sole reason.  :)
  697.  
  698. - -
  699.  
  700. Brad Andrews
  701. Brad.Andrews@cas.org
  702. All opinions are strictly mine
  703.  
  704.  
  705. ---------------------------
  706.  
  707. >From perdue@csn.org (James "Newt" Perdue)
  708. Subject: HELP - PICT File ColorTables and Palettes
  709. Date: 7 Apr 1994 10:50:49 -0500
  710. Organization: UTexas Mail-to-News Gateway
  711.  
  712. I'm pulling my hair out over this one: I'm trying to read Pict files,
  713. display them and have their colors be accurate (256 colors):
  714.  
  715. I read a PICT file that I created in PhotoShop. 
  716.  
  717. I use DrawPicture to transfer it to an off-screen GWorld.
  718.  
  719. I use the Picture Utilities GetPictInfo to return a Palette.
  720.  
  721. I install the Palette and everything is great! Colors are correct.
  722.  
  723. BUT....
  724.  
  725. The Picture Utilities takes TOO LONG for a commercial application I am
  726. building.  So,  I need a way to merely access the color table that comes
  727. along with the Pict file and build my own Palette.  Looking at the pmTable
  728. field in the offscreen GWORLD after I do the DrawPicture, it doesn't change
  729. from Pict to Pict.  WHAT TO DO???  I can't believe that there is not a way
  730. to access the colortable directly from the Pict.  
  731.  
  732. I am in desperate need to meet a deadline on this one. Any help would be
  733. appreciated. (The person to help me solve it will get a free CD-ROM I am
  734. developing!)
  735.  
  736. Thanks
  737.  
  738. Newt Perdue
  739.  
  740. Newt Perdue                                           rmdp@csn.org
  741. Rocky Mountain Digital Peeks                        1-303-258-3779
  742. PO Box 1576                                    
  743. Nederland, CO 80466 
  744.  
  745.  
  746.  
  747. +++++++++++++++++++++++++++
  748.  
  749. >From Carl R. Osterwald <carl_osterwald@nrel.gov>
  750. Date: Thu, 7 Apr 94 18:13:42 GMT
  751. Organization: National Renewable Energy Laboratory
  752.  
  753. In article <199404071550.AA22028@teal.csn.org> James, perdue@csn.org
  754. writes:
  755. >from Pict to Pict.  WHAT TO DO???  I can't believe that there is not a
  756. way
  757. >to access the colortable directly from the Pict.  
  758.  
  759. It is possible, although it may not be entirely easy.  You need to root
  760. through the PICT data looking for opcodes $0090 or $0098, which are for
  761. rect-clipped CopyBits, to find the offset to the color table.  The first
  762. block of data for these opcodes is the PixMap, which $32 bytes long. 
  763. Following the PixMap is the color table.  Assuming the PICT file just
  764. contains a PixMap from PhotoShop, you might be able to get away with
  765. parsing just a few of the opcodes listed in IM Vol. V to get to the
  766. CopyBits portion.  If not, you will need to parse most or all of the
  767. opcodes.  Most are easy, but a number of them are variable length, which
  768. will complicate things.
  769.  
  770. +++++++++++++++++++++++++++
  771.  
  772. >From giles@med.cornell.edu (Aaron Giles)
  773. Date: Thu, 07 Apr 1994 17:10:59 -0500
  774. Organization: Cornell University Medical College
  775.  
  776. In article <A9C99B66E0017D1A@cro.nrel.gov>, Carl R. Osterwald
  777. <carl_osterwald@nrel.gov> wrote:
  778.  
  779. > In article <199404071550.AA22028@teal.csn.org> James, perdue@csn.org
  780. > writes:
  781. > >from Pict to Pict.  WHAT TO DO???  I can't believe that there is not a
  782. > >way to access the colortable directly from the Pict.  
  783. > It is possible, although it may not be entirely easy.  You need to root
  784. > through the PICT data looking for opcodes $0090 or $0098, which are for
  785. > rect-clipped CopyBits, to find the offset to the color table.....
  786.  
  787. No, no, no!  There is a completely clean, fast way of doing just what you
  788. want.  It's called the QuickDraw Bottleneck, and if you deal with PICTs
  789. extensively, you'll need to know how to do it.  For this case, you write a
  790. StdBits bottleneck, which gets called whenever a CopyBits is performed in
  791. the port, and in that bottleneck, you copy out the color table of the
  792. source PixMap (since that's where the color data is coming from).  The
  793. code will look something like this:
  794.  
  795. CTabHandle gMyColors;
  796.  
  797. CTabHandle MyGetPICTColors(myPicture)
  798. {
  799.    CQDProcs myProcs, *oldProcs;
  800.  
  801.    gMyColors = nil;                   // nil result in case no colors found
  802.    SetPort(myDummyPort);              // point to where drawing won't be seen
  803.    SetStdCProcs(&myProcs);            // set up standard pointers
  804.    myProcs.bitsProc = MyStdBitsProc;  // use UPP here if compiling for PowerPC
  805.    oldProcs = myDummyPort->grafProcs; // save old bottlenecks
  806.    myDummyPort->grafProcs = &myProcs; // install our new bottlenecks
  807.    DrawPicture(myPicture, &destRect); // this does all the magic
  808.    myDummyPort->grafProcs = oldProcs; // restore old bottlenecks
  809.    return gMyColors;                  // return the global result
  810. }
  811.  
  812. pascal void MyStdBitsProc(BitMap *srcMap, Rect *srcRect, Rect *dstRect,
  813.          short tMode, RgnHandle maskRgn)
  814. {
  815.    PixMapPtr thePixMap = (PixMapPtr)srcMap; // cast as a PixMapPtr
  816.  
  817.    if (thePixMap->rowBytes & 0x8000) { // verify that this is a color source
  818.       gMyColors = thePixMap->pmTable;  // get the color table handle
  819.       HandToHand(&gMyColors);          // make a copy
  820.    }
  821. }
  822.  
  823. Note that there's no error checking or niceties here, but this shows you
  824. the general technique.
  825.  
  826. Aaron
  827. -- 
  828. Aaron Giles
  829. Power Macintosh & Newton developer
  830. Cornell University Medical College
  831. giles@med.cornell.edu
  832.  
  833. ---------------------------
  834.  
  835. >From lehmann@bert.cs.byu.edu (Ralf Lehmann)
  836. Subject: Max # of open files
  837. Date: 25 Mar 1994 22:53:08 GMT
  838. Organization: Brigham Young University
  839.  
  840. >From inside my program, it seems I can only open about 12 files
  841. simultaneously.  What do I need to do (Toolbox call, Control
  842. Panel, whatever...) to open more files than that ?
  843.  
  844. Thanks,
  845. Ralf.
  846.  
  847. +++++++++++++++++++++++++++
  848.  
  849. >From sro@media.mit.edu (Shawn O'Donnell)
  850. Date: Sat, 26 Mar 1994 01:45:19 GMT
  851. Organization: M.I.T. Media Laboratory
  852.  
  853. > it seems I can only open about 12 files simultaneously.  What do I
  854. >  need to do... to open more files than that ?
  855.  
  856. You can set that in your AUTOEXEC.BAT file.
  857.  
  858.  :)
  859.  
  860. --Shawn
  861.  
  862. P.S.  Do you know why you can't open more?  Are you running out of 
  863. memory?  Running out of pointers?  Try calling MoreMasters() and/or
  864. allocating more RAM to the program.  
  865.  
  866. +++++++++++++++++++++++++++
  867.  
  868. >From devon_hubbard@taligent.com (Devon Hubbard)
  869. Date: Fri, 25 Mar 1994 23:15:25 GMT
  870. Organization: Taligent, Inc.
  871.  
  872. In article <lehmann-250394155007@babbage.cs.byu.edu>,
  873. lehmann@bert.cs.byu.edu (Ralf Lehmann) wrote:
  874.  
  875. > From inside my program, it seems I can only open about 12 files
  876. > simultaneously.  What do I need to do (Toolbox call, Control
  877. > Panel, whatever...) to open more files than that ?
  878. > Thanks,
  879. > Ralf.
  880.  
  881. Are you using ANSI lib calls or regular toolbox OS calls?  If you are using
  882. ANSI (and I'll assume for a moment MPW) then StdCLib's limit of 20 open
  883. files at a time still isn't your problem.  If you are using regular toolbox
  884. calls you still shouldn't have a problem opening 12 files.  Do you have a
  885. ton of fonts in your system?  If you are under System 7, that shouldn't be
  886. a problem.
  887.  
  888. Can you be specific about why you can't open more than 12 files.  What
  889. error codes are you getting back, etc?
  890.  
  891. - ------------------------------------------------------------------------
  892. Devon Hubbard                                                Silicon Pilot
  893. devon_hubbard@taligent.com                                   Taligent, Inc
  894.  
  895. +++++++++++++++++++++++++++
  896.  
  897. >From Aaron Bratcher <aaron_bratcher@fpm.uchicago.edu>
  898. Date: Sat, 26 Mar 1994 14:01:31 GMT
  899. Organization: University of Chicago
  900.  
  901. In article <SRO.94Mar25204519@media-lab.media.mit.edu> Shawn O'Donnell, sro@media.mit.edu writes:
  902. >You can set that in your AUTOEXEC.BAT file.
  903.  
  904. That should be the CONFIG.SYS file  ;)
  905.  
  906. - ------------------------------------------------------------------------
  907.      MegaWatt                         |    _____  _____  _____   _   _ 
  908.                                       |   |__  / | ___ || ___ \ | | | |
  909. AKA  Aaron L. Bratcher                |     / /  | |_| || |_/ / | | | |
  910.      University of Chicago            |    / /__ | ___ ||  __/  |_| |_|
  911.      aaron_bratcher@fpm.uchicago.edu  |   |_____||_| |_||_|     (_) (_)
  912. - ------------------------------------------------------------------------
  913.  
  914. +++++++++++++++++++++++++++
  915.  
  916. >From lehmann@bert.cs.byu.edu (Ralf Lehmann)
  917. Date: 29 Mar 1994 17:19:44 GMT
  918. Organization: Brigham Young University
  919.  
  920. OK, OK, here some more information about what I'm trying to do:
  921. I use Think C 5.0, I need to use portable functions, that's why
  922. I use open or fopen from the ANSI library.  Following your
  923. suggestions, I tried to replace the open function by the Create
  924. function, and indeed, it worked (I aborted the program after 500
  925. had been created... what a mess to put them in the trash can...)
  926. So it seems that Think C's library is at fault.  Why would it
  927. limit the # of open files ? Isn't it just calling Create or FSOpen ?
  928. Here is my little test program:
  929.  
  930. #include <stdio.h>
  931. #include <unix.h>
  932. #include <fcntl.h>
  933.  
  934. void main ()
  935.     {
  936.     int i;
  937.     char name[5];
  938.         
  939.     for (i = 0; ; i++)
  940.         {
  941.         sprintf (name, "_t%d", i);
  942.         if (open (name, O_CREAT) == -1) break;
  943.         }
  944.     printf ("max open files: %d\n", i);
  945.     }
  946.  
  947. +++++++++++++++++++++++++++
  948.  
  949. >From leblonk@netcom.com (Marcel Blonk)
  950. Date: Tue, 29 Mar 1994 21:59:31 GMT
  951. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  952.  
  953. : So it seems that Think C's library is at fault.  Why would it
  954. : limit the # of open files ? Isn't it just calling Create or FSOpen ?
  955.  
  956. Under system 6, the number of open files on a mac is limited. With the 
  957. standard configuration, you would be able to open about 12 files (that 
  958. is, depending on how many other files are opened by the system and other 
  959. apps). One way to fix this is by using SuitCase, which has a power user 
  960. setting somewhere that allows you to up the max # of open files.
  961. This I know for sure.
  962. What I don't know for sure:
  963. I think/seem_to_remember that under system 7 the FCB's are dynamically 
  964. allocated, so there is no longer a limit to the number of open files. 
  965. Again, I'm not sure. Are you using system 7?
  966.  
  967. Btw. I think the reason why your little test program works is because you 
  968. only create files, but you do not actually keep them open.
  969.  
  970. Marcel
  971.  
  972.  
  973. +++++++++++++++++++++++++++
  974.  
  975. >From rollin@newton.apple.com (Keith Rollin)
  976. Date: Fri, 1 Apr 1994 06:58:37 GMT
  977. Organization: Little to none
  978.  
  979. In article <lehmann-250394155007@babbage.cs.byu.edu>,
  980. lehmann@bert.cs.byu.edu (Ralf Lehmann) wrote:
  981.  
  982. > From inside my program, it seems I can only open about 12 files
  983. > simultaneously.  What do I need to do (Toolbox call, Control
  984. > Panel, whatever...) to open more files than that ?
  985.  
  986. Sounds like you're using C's stdio. There's this comment thing inside of
  987. StdIO.h that you might want to read:
  988.  
  989. /*
  990.  *    The minimum number of files that a program is guaranteed to be able to
  991. have
  992.  *    open simultaneously (including the pre-opened stdin, stdout, and
  993. stderr).
  994.  *    The numbers are listed in Inside Macintosh, page IV-178, as:
  995.  *    64K ROM, 128K Macintosh        12 files
  996.  *    64K ROM, 512K Macintosh        40 files
  997.  *    128K ROM                    40 files per volume
  998.  */
  999.  
  1000. #define FOPEN_MAX    12
  1001.  
  1002. That's from MPW. Symantec C 6.0 sets this to 15, without any comments.
  1003.  
  1004. How do you fix this? If you're using MPW, you'll probably have to rewrite
  1005. your program to either a) live with the limit or b) using the File Manager
  1006. calls. If you're using THINK C, you can probably just recompile the
  1007. libraries.
  1008.  
  1009. - --------------------------------------------------------------------------
  1010. Keith Rollin --- Phantom Programmer --- Apple Computer, Inc. --- Team
  1011. Newton
  1012.  
  1013. +++++++++++++++++++++++++++
  1014.  
  1015. >From neeri@iis.ee.ethz.ch (Matthias Neeracher)
  1016. Date: 7 Apr 94 11:02:25
  1017. Organization: Integrated Systems Laboratory, ETH, Zurich
  1018.  
  1019. In article <rollin-310394225838@rollin-keith.apple.com>, rollin@newton.apple.com (Keith Rollin) writes:
  1020.  
  1021. > In article <lehmann-250394155007@babbage.cs.byu.edu>,
  1022. > lehmann@bert.cs.byu.edu (Ralf Lehmann) wrote:
  1023.  
  1024. >> From inside my program, it seems I can only open about 12 files
  1025. >> simultaneously.  What do I need to do (Toolbox call, Control
  1026. >> Panel, whatever...) to open more files than that ?
  1027.  
  1028. > Sounds like you're using C's stdio. There's this comment thing inside of
  1029. > StdIO.h that you might want to read:
  1030. >[...]
  1031. > #define FOPEN_MAX    12
  1032.  
  1033. > That's from MPW. Symantec C 6.0 sets this to 15, without any comments.
  1034.  
  1035. > How do you fix this? If you're using MPW, you'll probably have to rewrite
  1036. > your program to either a) live with the limit or b) using the File Manager
  1037. > calls.
  1038.  
  1039. Alternatively, you can do the following, at least with MPW 3.2 and MPW 3.3:
  1040.  
  1041. /* Allocate more stdio buffers */
  1042.  
  1043. FILE _iob[64] = {
  1044.     0, nil, nil, nil, 0, _IOREAD,         0,
  1045.     0, nil, nil, nil, 0, _IOWRT,          1,
  1046.     0, nil, nil, nil, 0, _IOWRT+_IOLBF,    2
  1047. };
  1048.     
  1049. FILE * _lastbuf = _iob + 64;
  1050.  
  1051. The Linker will warn you, forgive him if you know what you're doing :-)
  1052.  
  1053. Matthias
  1054.  
  1055. - ---
  1056. Matthias Neeracher                                  neeri@iis.ee.ethz.ch
  1057.   "And that's why I am going to turn this world upside down, and make
  1058.    of it a fire so *bright* that someone real will notice"
  1059.                                 -- Vernor Vinge, _Tatja Grimm's World_
  1060.  
  1061. ---------------------------
  1062.  
  1063. >From west@augsburg.edu (James West)
  1064. Subject: Proper QT PICT creation?
  1065. Date: 31 Mar 1994 20:59:20 GMT
  1066. Organization: Augsburg College
  1067.  
  1068. I am trying to create a custom interface for a digital camera that
  1069. downloads a JPEG (or JFIF) image via the serial port. So far, it is set up
  1070. so that an appleevent triggers the camera to snap a photo, and another
  1071. appleevent orders the camera to download the image. So far so good.
  1072.  
  1073. My challenge is to convert the photo to a QT PICT. Right now I have had
  1074. some success by canabalizing existing JPEG PICT's and pasting the opcodes
  1075. onto the JFIF data. I realize this is very bad technique, and would like to
  1076. be able to do this in a proper fashion.
  1077.  
  1078. I understand the basic process for creating a PICT file containing a
  1079. compressed image, but I am somewhat confused when it comes to the
  1080. imagedesc(?) structure that needs to be passed with the decompressImage
  1081. funtion. Since quicktime did not compress this image (which is usually when
  1082. the imagedesc is created), what do I use for this value? Can I steal a
  1083. imagedesc from an existing JPEG PICT and use that after some tweaking to my
  1084. specifications (height and width, ect.)? This option seems to kind of make
  1085. me a cannibal again. Are there published standards for creating this
  1086. structure?
  1087.  
  1088. I would also love to have this QT PICT version of this image pasted onto
  1089. the clipboard for further use. Is this supported and is there any way this
  1090. could be done with my image grabbing app in the background?
  1091.  
  1092. ANY pointers and/or kicks in the side of the head are welcome. Thanks
  1093.  
  1094. -- 
  1095. James West                             ***** I like Cacti... ****
  1096. Augsburg College Graphic Center
  1097. 731 21st Ave S
  1098. Mpls. MN 55454        
  1099. west@augsburg.edu                      ********  OUTCH!! ********
  1100.  
  1101. +++++++++++++++++++++++++++
  1102.  
  1103. >From markhanrek@aol.com (MarkHanrek)
  1104. Date: 1 Apr 1994 13:31:04 -0500
  1105. Organization: America Online, Inc. (1-800-827-6364)
  1106.  
  1107. On the QuickTime CD, there is source code for taking a standard JFIF file, and
  1108. feeding it to one of the Quicktime routines, FDecompress I believe, so that you
  1109. end up with a normal everyday PixMap of the image.
  1110.  
  1111. ( Note that the resulting image quality is not as good as is obtainable with
  1112. the standard JPEG decompression routines available from the Independent JPEG
  1113. Group (uunet.uu.net) . This may change with the impending release of QuickTime
  1114. 2.0 ).
  1115.  
  1116. At this point, you have a straight pixmap of your image, and the following
  1117. "intermediate" steps have nothing to do with QuickTime, or JPEG. 
  1118.  
  1119. You have a PixMap of the image, and you can easily turn it into a Macintosh
  1120. picture using the standard method of opening a new picture and copybitsing the
  1121. image to itself, and closing the picture, yielding a picture.
  1122.  
  1123. You can save this picture to the clipboard, draw it to the screen, or write it
  1124. to a PICT file.
  1125.  
  1126. To put it on disk as a QT Compressed PICT, you use additional functions found
  1127. in the QuickTime toolkit to compress the pixmap and write out a QT compressed
  1128. file.
  1129.  
  1130. If at all possible, you really do want try to stand on the shoulders of the
  1131. routines provided along with the QuickTime CD's example source code.
  1132.  
  1133. I have done a wide variety of things in this regard, and I couldn't answer your
  1134. question about ImageDescriptors, most likely because I took the example source
  1135. code and treated it as a black box, and have never had to deal with knowing
  1136. these details, thank god! :)
  1137.  
  1138. See if you can't get a hold of the stuff on the QuickTime Developer's Toolkit
  1139. CD. ( or whatever it is called exactly ).
  1140.  
  1141. Hope this helps.
  1142.  
  1143. Mark Hanrek
  1144.  
  1145.  
  1146. +++++++++++++++++++++++++++
  1147.  
  1148. >From Steve Bryan <sbryan@maroon.tc.umn.edu>
  1149. Date: Sat, 2 Apr 1994 05:14:22 GMT
  1150. Organization: Sexton Software
  1151.  
  1152. In article <west-310394144925@141.224.192.172> James West,
  1153. west@augsburg.edu writes:
  1154. >I understand the basic process for creating a PICT file containing a
  1155. >compressed image, but I am somewhat confused when it comes to the
  1156. >imagedesc(?) structure that needs to be passed with the decompressImage
  1157. >funtion. Since quicktime did not compress this image (which is usually
  1158. when
  1159. >the imagedesc is created), what do I use for this value? Can I steal a
  1160. >imagedesc from an existing JPEG PICT and use that after some tweaking to
  1161. my
  1162. >specifications (height and width, ect.)? This option seems to kind of
  1163. make
  1164. >me a cannibal again. Are there published standards for creating this
  1165. >structure?
  1166.  
  1167. You're probably already aware of it but just in case (and for others)
  1168. there is significant discussion of this topic in Inside Macintosh:
  1169. QuickTime starting on page 3-24. A good (the best?) general reference for
  1170. JPEG  is "JPEG Still Image Data Compression Standard" by Pennebaker and
  1171. Mitchell from Van Nostrand (ISBN 0-442-01272-1). If you're looking for
  1172. the book in Minneapolis try Borders Books at Hennepin & Lake, they have
  1173. it in stock.
  1174. Steve Bryan                  InterNet: sbryan@maroon.tc.umn.edu
  1175. Sexton Software            CompuServe: 76545,527
  1176. Minneapolis, MN                   Fax: (612) 929-1799
  1177.  
  1178. +++++++++++++++++++++++++++
  1179.  
  1180. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  1181. Date: 5 Apr 94 12:40:49 +1300
  1182. Organization: University of Waikato, Hamilton, New Zealand
  1183.  
  1184. In article <2nhp98$8am@search01.news.aol.com>, markhanrek@aol.com (MarkHanrek) writes:
  1185. > On the QuickTime CD, there is source code for taking a standard JFIF file, and
  1186. > feeding it to one of the Quicktime routines, FDecompress I believe, so that you
  1187. > end up with a normal everyday PixMap of the image.
  1188. >
  1189. ...
  1190. >
  1191. > You have a PixMap of the image, and you can easily turn it into a Macintosh
  1192. > picture using the standard method of opening a new picture and copybitsing the
  1193. > image to itself, and closing the picture, yielding a picture.
  1194. >
  1195. > You can save this picture to the clipboard, draw it to the screen, or write it
  1196. > to a PICT file.
  1197. >
  1198. > To put it on disk as a QT Compressed PICT, you use additional functions found
  1199. > in the QuickTime toolkit to compress the pixmap and write out a QT compressed
  1200. > file.
  1201.  
  1202. Note that the decompress calls are drawing calls. This means that, if you have
  1203. a QuickDraw picture open, the _compressed_ data will be recorded directly in
  1204. the picture. This is better than decompressing the data into a PixMap, and
  1205. then recompressing it, with the consequent loss of even more image quality.
  1206.  
  1207. I do actually have some code somewhere that fakes an ImageDescription structure
  1208. for a JPEG image. I think it still works. :-)
  1209.  
  1210. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  1211. Info & Tech Services Division              fax: +64-7-838-4066
  1212. University of Waikato            electric mail: ldo@waikato.ac.nz
  1213. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  1214.  
  1215. +++++++++++++++++++++++++++
  1216.  
  1217. >From west@augsburg.edu (James West)
  1218. Date: 5 Apr 1994 16:57:28 GMT
  1219. Organization: Augsburg College
  1220.  
  1221. Great replies- thanks folks! Here's where I'm at...
  1222.  
  1223. > Note that the decompress calls are drawing calls. This means that, if you have
  1224. > a QuickDraw picture open, the _compressed_ data will be recorded directly in
  1225. > the picture. This is better than decompressing the data into a PixMap, and
  1226. > then recompressing it, with the consequent loss of even more image quality.
  1227. > I do actually have some code somewhere that fakes an ImageDescription structure
  1228. > for a JPEG image. I think it still works. :-)
  1229.  
  1230. I did end up going this route, because I did want the data to be compressed
  1231. and avoid the data loss of recompression. The ImageDescription that I
  1232. created also seems to work fine for the DecompressImage call recorded to a
  1233. picture. I don't think there should be a problem using this option in this
  1234. application, since the resolution and depth of my JPEG data from this
  1235. camera will always be constant.
  1236.  
  1237. My only problem now is trying to get the picture pasted to the clipboard
  1238. when this application is running in the background. Works fine when it's a
  1239. foreground app, but while backgrounding it either silently fails to get the
  1240. picture onto the scrap, or drops into MacsBug (but that may be another
  1241. problem :-(   ).
  1242. -- 
  1243.  
  1244. James West                             ***** I like Cacti... ****
  1245. Augsburg College Graphic Center
  1246. 731 21st Ave S
  1247. Mpls. MN 55454        
  1248. west@augsburg.edu                      ********  OUTCH!! ********
  1249.  
  1250. +++++++++++++++++++++++++++
  1251.  
  1252. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  1253. Date: 7 Apr 94 11:34:24 +1300
  1254. Organization: University of Waikato, Hamilton, New Zealand
  1255.  
  1256. In article <1994Apr5.124049.27222@waikato.ac.nz>, I said:
  1257. >
  1258. > Note that the decompress calls are drawing calls. This means that, if you have
  1259. > a QuickDraw picture open, the _compressed_ data will be recorded directly in
  1260. > the picture. This is better than decompressing the data into a PixMap, and
  1261. > then recompressing it, with the consequent loss of even more image quality.
  1262. >
  1263. > I do actually have some code somewhere that fakes an ImageDescription structure
  1264. > for a JPEG image. I think it still works. :-)
  1265.  
  1266. OK, here are some relevant extracts from a quick-and-dirty tool I wrote a
  1267. couple of years ago for turning JPEG files into PICT files. I discovered very
  1268. little of this information myself: in particular, Dolf Starreveld at Storm
  1269. Technologies was kind enough to tell me enough about JPEG and JFIF formats to
  1270. make this work.
  1271.  
  1272. Note: "JpegData" points to a buffer containing the contents of the JPEG
  1273. file. The number of bytes is in "JpegDataSize". First you need to scan this,
  1274. looking for the bounds of the image. You don't really need the whole file for
  1275. this: the information should be present somewhere within the first 1K:
  1276.  
  1277.     PROCEDURE FindPictureSize;
  1278.       (* scans the JPEG data, looking for the information about
  1279.     the dimensions of the image. *)
  1280.  
  1281.     VAR
  1282.         NextByte, DataEnd : ADDRESS;
  1283.         TwoBytes :
  1284.         RECORD
  1285.         CASE : CARDINAL OF
  1286.         | 1:
  1287.             HighByte, LowByte : BYTE;
  1288.         | 2:
  1289.             SignedWord : INTEGER
  1290.         END (*CASE*)
  1291.         END (*RECORD*);
  1292.         Msg, TempStr : Str255;
  1293.  
  1294.     BEGIN
  1295.     NextByte := JpegData;
  1296.     DataEnd := JpegData + JpegDataSize;
  1297.     LOOP
  1298.         IF NextByte = DataEnd THEN
  1299.         ErrorLiteral('couldnUt determine JPEG image bounds', ProcessingError);
  1300.         EXIT
  1301.         END (*IF*);
  1302.         IF ORD(NextByte^) = 0FFH THEN
  1303.         INC(NextByte);
  1304.         IF NextByte = DataEnd THEN
  1305.             ErrorLiteral('malformed JPEG file', ProcessingError);
  1306.             EXIT
  1307.         END (*IF*);
  1308.         IF ORD(NextByte^) = 0C0H THEN
  1309.             INC(NextByte);
  1310.             IF DataEnd - NextByte >= 7 THEN
  1311.             NextByte := NextByte + 3;
  1312.             TwoBytes.HighByte := NextByte^;
  1313.             INC(NextByte);
  1314.             TwoBytes.LowByte := NextByte^;
  1315.             INC(NextByte);
  1316.             PictureSize.v := TwoBytes.SignedWord;
  1317.             TwoBytes.HighByte := NextByte^;
  1318.             INC(NextByte);
  1319.             TwoBytes.LowByte := NextByte^;
  1320.             INC(NextByte);
  1321.             PictureSize.h := TwoBytes.SignedWord;
  1322.             MakeCounted('Image size (h, v) = (', Msg);
  1323.             NumToString(PictureSize.h, TempStr);
  1324.             AppendCounted(ADR(TempStr), Msg);
  1325.             AppendtoCounted(', ', Msg);
  1326.             NumToString(PictureSize.v, TempStr);
  1327.             AppendCounted(ADR(TempStr), Msg);
  1328.             AppendtoCounted(')', Msg);
  1329.             ErrorString(Msg, Success);
  1330.             EXIT
  1331.             ELSE
  1332.             ErrorLiteral('malformed bounds info', ProcessingError);
  1333.             EXIT
  1334.             END (*IF*)
  1335.         END (*IF*)
  1336.         ELSE
  1337.         INC(NextByte)
  1338.         END (*IF*)
  1339.     END (*LOOP*)
  1340.     END FindPictureSize;
  1341.  
  1342. Then, you build the fake ImageDescription and record the data into a
  1343. picture:
  1344.  
  1345.     PROCEDURE BuildPicture;
  1346.  
  1347.     VAR
  1348.         Description : ImageDescriptionHandle;
  1349.         PictureBounds : Rect;
  1350.         TempPort : CGrafPort;
  1351.  
  1352.     BEGIN (*BuildPicture*)
  1353.     Description := NewHandle(SIZE(ImageDescription));
  1354.     Description^^.idSize := SIZE(ImageDescription);
  1355.     Description^^.cType := 06A706567H (* 'jpeg' *);
  1356.     Description^^.resvd1 := 0;
  1357.     Description^^.resvd2 := 0;
  1358.     Description^^.dataRefIndex := 0;
  1359.     Description^^.version := 0;
  1360.     Description^^.revisionLevel := 0;
  1361.     Description^^.vendor := 06170706CH (* 'appl' *);
  1362.     Description^^.temporalQuality := ImageCompression.codecMinQuality;
  1363.     Description^^.spatialQuality := ImageCompression.codecNormalQuality; (* is this significant? *)
  1364.     Description^^.width := PictureSize.h;
  1365.     Description^^.height := PictureSize.v;
  1366.     Description^^.hRes := FixRatio(72, 1);
  1367.     Description^^.vRes := FixRatio(72, 1);
  1368.     Description^^.dataSize := JpegDataSize;
  1369.     Description^^.frameCount := 1;
  1370.     Description^^.name[0] := 0C;
  1371.     Description^^.depth := 32; (* I hope! *)
  1372.     Description^^.clutID := -1;
  1373.     OpenCPortVar(TempPort);
  1374.     PictureBounds.top := 0;
  1375.     PictureBounds.left := 0;
  1376.     PictureBounds.botRight := PictureSize;
  1377.     ClipRect(PictureBounds);
  1378.     Picture := OpenPicture(PictureBounds);
  1379.     Err := DecompressImage
  1380.       (
  1381.         (*data :=*) JpegData,
  1382.         (*desc :=*) Description,
  1383.         (*dst :=*) TempPort.portPixMap,
  1384.         (*srcRect :=*) ADR(PictureBounds),
  1385.         (*@dstRect :=*) PictureBounds,
  1386.         (*mode :=*) QuickDraw.ditherCopy,
  1387.         (*mask :=*) NIL
  1388.       );
  1389.     ClosePicture;
  1390.     IF Err <> noErr THEN
  1391.         OSError(Err)
  1392.     END (*IF*);
  1393.     CloseCPortVar(TempPort);
  1394.     DisposeHandle(Description)
  1395.     END BuildPicture;
  1396.  
  1397. Hope that helps.
  1398.  
  1399. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  1400. Info & Tech Services Division              fax: +64-7-838-4066
  1401. University of Waikato            electric mail: ldo@waikato.ac.nz
  1402. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  1403.  
  1404. ---------------------------
  1405.  
  1406. >From heilei@colossus.cs.hut.fi (Heikki Leinonen)
  1407. Subject: Q: Changing font & size of dialog items
  1408. Date: 31 Mar 1994 13:18:34 GMT
  1409. Organization: Helsinki University of Technology, Finland
  1410.  
  1411.  
  1412.   Greetings from the depths of Dialog Manager
  1413.  
  1414.   (possible FAQ alert...)
  1415.  
  1416.   So I make my DLOGs and DITLs with ResEdit, call GetNewDialog
  1417.   and ModalDialog in my program and so on. And then comes the
  1418.   tough part: is there a SIMPLE way to make *all* the texts
  1419.   (meaning static and edit texts, button and check box titles etc.)
  1420.   in my dialog something else than Chicago 12?  SetDAFont seems
  1421.   to handle only the font name, not the size. And it won't
  1422.   change the controls. If I created the controls myself, I could
  1423.   add the useWFont constant to controls' definition values. But
  1424.   making the layout with ResEdit is SOOOOO easy...
  1425.  
  1426.   Anyone have any bright ideas on this one? 
  1427.  
  1428.  
  1429.   Heikki Leinonen
  1430.  
  1431.   heilei@otax.tky.hut.fi
  1432.   Helsinki University of Technology
  1433.   Finland
  1434.  
  1435.  
  1436.  
  1437.  
  1438. +++++++++++++++++++++++++++
  1439.  
  1440. >From resnick@cogsci.uiuc.edu (Pete Resnick)
  1441. Date: Thu, 31 Mar 1994 12:06:05 -0600
  1442. Organization: University of Illinois at Urbana-Champaign
  1443.  
  1444. In article <2neija$i2@nntp.hut.fi>, heilei@colossus.cs.hut.fi (Heikki
  1445. Leinonen) wrote:
  1446.  
  1447. >  So I make my DLOGs and DITLs with ResEdit, call GetNewDialog
  1448. >  and ModalDialog in my program and so on. And then comes the
  1449. >  tough part: is there a SIMPLE way to make *all* the texts
  1450. >  (meaning static and edit texts, button and check box titles etc.)
  1451. >  in my dialog something else than Chicago 12?
  1452.  
  1453. You need to create an ictb resource. Unfortunately, ResEdit does not have
  1454. an ictb editor. Resourserer (sp?) is able to create them, or you can use
  1455. Rez.
  1456.  
  1457. pr
  1458. -- 
  1459. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  1460. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  1461. System manager - Cognitive Science Group, Beckman Institute, UIUC
  1462. Internet: resnick@cogsci.uiuc.edu
  1463.  
  1464. +++++++++++++++++++++++++++
  1465.  
  1466. >From Vampire@crypt.demon.co.uk (Vampire)
  1467. Date: Fri, 1 Apr 1994 00:41:37 GMT
  1468. Organization: Pennangalan Software
  1469.  
  1470.  
  1471. In article <2neija$i2@nntp.hut.fi> heilei@colossus.cs.hut.fi (Heikki Leinonen)
  1472. writes:
  1473. >  tough part: is there a SIMPLE way to make *all* the texts
  1474. >  (meaning static and edit texts, button and check box titles etc.)
  1475. >  in my dialog something else than Chicago 12?  SetDAFont seems
  1476. >  to handle only the font name, not the size. And it won't
  1477. >  change the controls.
  1478.  
  1479. All objects in a Dialog box use the font of the Dialog's GrafPort. SetDAFont()
  1480. changes a global setting for the font to use in ALL subsequent Dialog Manager
  1481. Windows. 
  1482.  
  1483. What you need to do is set the font and textsize of the GrafPort directly. The
  1484. way to do this is with the QuickDraw calls TextFont() and TextSize() [See IM
  1485. Vol 1 - p171]. These routines affect the ~current~ port, so you'll need to do
  1486. something like this...
  1487.  
  1488. [C Code]
  1489. DialogPtr    pMyDialog = GetNewDialog(blah blah blah);
  1490.  
  1491.     GetPort(&SavePort);
  1492.     SetPort(pMyDialog);
  1493.     TextFont(rhubarb);
  1494.     Textsize(baloney);
  1495.     SetPort(SavePort);
  1496.     ShowWindow(pMyDialog);
  1497.  
  1498. You need the code to save and restore the current grafport, as the Dialog
  1499. Manager normally does this for you, so it is probably missing from any code you
  1500. have written (DialogSelect() and ModalDialog() handle the grafports
  1501. automatically).
  1502.  
  1503. The above ~should~ work...I ~think~ it does for me, but I haven't written
  1504. anything recently that used it...
  1505.  
  1506. PS. If you only ant to change the text of editText items, you can do it by
  1507. directly modifying the contents of the Dialog's TERec structure...you can get
  1508. this by casting your DialogPtr to type DialogPeek, and dereferencing it as
  1509. follows:
  1510.  
  1511. TEHandle myDialogText = ((DialogPeek) pMyDialog)->textH;    [IM Vol 1, p408]
  1512.  
  1513. Best of luck...
  1514.  
  1515. =============================================================================
  1516.                                   |"If I knock on your door, you're a fool;
  1517.          VAMPIRE                  | if you invite me in, you're a dead fool"
  1518.   (Pennangalan Software)          |  My dust resides @crypt.demon.co.uk
  1519. =============================================================================
  1520.  
  1521. +++++++++++++++++++++++++++
  1522.  
  1523. >From t-gaul@i-link.com (Troy Gaul)
  1524. Date: Fri, 01 Apr 1994 14:04:27 -0600
  1525. Organization: I-Link, Ltd.
  1526.  
  1527. In article <84@crypt.demon.co.uk>, Vampire@crypt.demon.co.uk (Vampire)
  1528. wrote:
  1529.  
  1530. > In article <2neija$i2@nntp.hut.fi> heilei@colossus.cs.hut.fi (Heikki Leinonen)
  1531. > writes:
  1532. > >  tough part: is there a SIMPLE way to make *all* the texts
  1533. > >  (meaning static and edit texts, button and check box titles etc.)
  1534. > >  in my dialog something else than Chicago 12?  SetDAFont seems
  1535. > >  to handle only the font name, not the size. And it won't
  1536. > >  change the controls.
  1537. > All objects in a Dialog box use the font of the Dialog's GrafPort. SetDAFont()
  1538. > changes a global setting for the font to use in ALL subsequent Dialog Manager
  1539. > Windows. 
  1540. > What you need to do is set the font and textsize of the GrafPort directly. The
  1541. > way to do this is with the QuickDraw calls TextFont() and TextSize() [See IM
  1542. > Vol 1 - p171]. These routines affect the ~current~ port, so you'll need to do
  1543. > something like this...
  1544. > [C Code]
  1545. > DialogPtr    pMyDialog = GetNewDialog(blah blah blah);
  1546. >     GetPort(&SavePort);
  1547. >     SetPort(pMyDialog);
  1548. >     TextFont(rhubarb);
  1549. >     Textsize(baloney);
  1550. >     SetPort(SavePort);
  1551. >     ShowWindow(pMyDialog);
  1552.  
  1553. Actually, that will only change the Static and Edit text items, not the
  1554. controls (like buttons and checkboxes) in the dialog.  The only way that I
  1555. know of to change the font/size in the controls is to use CNTL resources
  1556. for each of those items and set the flag that tells the controls to use the
  1557. window's font.  (Note however that you must still change the port's
  1558. font/size for this to work.)
  1559.  
  1560. _troy
  1561. //////// //////___Troy Gaul_________________________t-gaul@i-link.com__ //
  1562.   //    //       I-Link, Ltd. ; West Des Moines, Iowa                  //
  1563.  //    //  //   "Iungo ergo sum." (I-Link, therefore I am.)           //
  1564. //    //////________________________________________________________ //
  1565.  
  1566. +++++++++++++++++++++++++++
  1567.  
  1568. >From resnick@cogsci.uiuc.edu (Pete Resnick)
  1569. Date: Fri, 01 Apr 1994 15:03:21 -0600
  1570. Organization: University of Illinois at Urbana-Champaign
  1571.  
  1572. In article <84@crypt.demon.co.uk>, Vampire@crypt.demon.co.uk (Vampire) wrote:
  1573.  
  1574. >All objects in a Dialog box use the font of the Dialog's GrafPort.
  1575. Not if you use an ictb resource.
  1576.  
  1577. pr
  1578. -- 
  1579. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  1580. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  1581. System manager - Cognitive Science Group, Beckman Institute, UIUC
  1582. Internet: resnick@cogsci.uiuc.edu
  1583.  
  1584. +++++++++++++++++++++++++++
  1585.  
  1586. >From dnewman@emx.cc.utexas.edu (David Newman)
  1587. Date: 1 Apr 1994 14:28:53 -0600
  1588. Organization: The University of Texas - Austin
  1589.  
  1590. In addition to what has been mentioned earlier, I was doing this the other
  1591. day, and I discovered an additional twist that noone has mentioned. If your
  1592. dialog includes an editable text box, you must set the text of that box to
  1593. the same text as the buttons (that is, the textFont must be the same for the
  1594. grafPort and for the TErec), otherwise, textedit will reset the font for the
  1595. grafPort.
  1596.  
  1597. Someone can correct me if they *know* better, since I'm a novice at such
  1598. things, but that was my diagnosis of the problem, and since I corrected
  1599. it, things work great.
  1600.  
  1601. >>Dave
  1602.  
  1603. P.S. Thanks to Leonard Rosenthal for pointing me in the right direction
  1604. when I had this problem, otherwise I wouldn't be able to answer.
  1605.  
  1606. +++++++++++++++++++++++++++
  1607.  
  1608. >From askwersk@athena.mit.edu (Adam Skwersky)
  1609. Date: 1 Apr 1994 19:39:36 GMT
  1610. Organization: Massachvsetts Institvte of Technology
  1611.  
  1612. In article <2neija$i2@nntp.hut.fi>, heilei@colossus.cs.hut.fi (Heikki
  1613. Leinonen) wrote:
  1614.  
  1615. >. If I created the controls myself, I could
  1616. >   add the useWFont constant to controls' definition values. But
  1617. >   making the layout with ResEdit is SOOOOO easy...
  1618. >   Anyone have any bright ideas on this one? 
  1619.  
  1620.  
  1621. I have had a similar problem. I was trying to use the custom Connection
  1622. Manager
  1623. Setup routines that add DITL's to your dialog and you use the DITL's to
  1624. setup up a certain tool. The items are all SUPPOSED to be in geneva 9, and
  1625. when you call the toolbox command CMChoose() thats what you get. However
  1626. if I were to add the DITL's to my OWN dialog, they all come out in
  1627. Chicago 12. I thought about trying to go through each dialog item and
  1628. changing its procID to procID+useWFont, but I could not even find the
  1629. procID field in the ControlHandle record! I'm really lost with this as
  1630. well,
  1631. and I do not think it is a FAQ. Do any Mac gurus out there know how to go
  1632. through a bunch of controls (dialog items) and change their fonts and
  1633. sizes?
  1634.  
  1635. Adam Skwersky
  1636. askwersk@mit.edu
  1637. adams@media.mit.edu
  1638.  
  1639. +++++++++++++++++++++++++++
  1640.  
  1641. >From hrodstein@aol.com (HRodstein)
  1642. Date: 2 Apr 1994 01:09:03 -0500
  1643. Organization: America Online, Inc. (1-800-827-6364)
  1644.  
  1645. I asked this question of Apple developer support a couple of months
  1646. ago. They told me I should use an ictb resource. This is documented
  1647. on page 279 of Inside Mac V. There are two problems.
  1648.  
  1649. First, neither ResEdit nor Rez know how to make ictb resources.
  1650. Resourcer does  know how to make it so you would either need
  1651. to hack it in hex or buy Resourcer.
  1652.  
  1653. Second, it will not work on machines without color QuickDraw
  1654. such as Mac Plus under System 6.
  1655.  
  1656. The technique of setting the font and text size of both the
  1657. dialog's grafPort and setting the font and text size of the
  1658. dialog's TextEdit record also seems to work if you want
  1659. to change editText and statText items only.
  1660.  
  1661. Howard Rodstein
  1662.  
  1663. +++++++++++++++++++++++++++
  1664.  
  1665. >From RobTerrell@aol.com (Rob Terrell)
  1666. Date: 4 Apr 1994 17:28:45 GMT
  1667. Organization: Jecta Development Corp.
  1668.  
  1669. In article <2nj25v$gfi@search01.news.aol.com>
  1670. hrodstein@aol.com (HRodstein) writes:
  1671.  
  1672. > First, neither ResEdit nor Rez know how to make ictb resources.
  1673. > Resourcer does  know how to make it so you would either need
  1674. > to hack it in hex or buy Resourcer.
  1675.  
  1676. I remember when I had to make these by hand a few years back...that was
  1677. no fun. So the real answer is...we need someone to cough up a ResEdit
  1678. 'ictb' editor.
  1679.  
  1680. Does anyone have such a beast they would be willing to contribute to
  1681. sumex?
  1682.  
  1683. Rob
  1684.  
  1685. +++++++++++++++++++++++++++
  1686.  
  1687. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  1688. Date: Thu, 7 Apr 1994 01:15:49 GMT
  1689. Organization: Apple Computer
  1690.  
  1691. Heikki Leinonen, heilei@colossus.cs.hut.fi writes:
  1692. >   is there a SIMPLE way to make *all* the texts
  1693. >   (meaning static and edit texts, button and check box titles etc.)
  1694. >   in my dialog something else than Chicago 12?
  1695.  
  1696. As has been said, you can use an 'ictb' resource. Unfortunately (maybe) these
  1697. aren't recognized on 68000 systems so if your program is supposed to run on
  1698. old hardware you can't use them.
  1699.  
  1700. One alternative thing I've done is to set the "useWFont" bit of the
  1701. variationCodes of the control items; this makes their text appear in the
  1702. current grafPort's font/size/style instead of the system font. Unfortunately,
  1703. to do this you have to temporarily patch NewControl during your call to
  1704. GetNewDialog, and in the patch set the appropriate bit in the variationCode
  1705. before calling the old trap address. It's a wee bit ugly but works fine.
  1706.  
  1707. Another solution is simply not using the Dialog Manager. This is really
  1708. feasible only if you have a framework (MacApp, TCL, PowerPlant...) that will
  1709. let you set up complex windows easily. I did this approach for the
  1710. AppleScript Script Editor, with a hand-rolled framework. It works great, but
  1711. the overhead is a bit high for a small app.
  1712.  
  1713. --Jens Alfke
  1714.   jens_alfke@powertalk              Rebel girl, rebel girl,
  1715.             .apple.com              Rebel girl you are the queen of my world
  1716.  
  1717. +++++++++++++++++++++++++++
  1718.  
  1719. >From tomcat@email.teaser.com ( Florent Pillet)
  1720. Date: Thu, 7 Apr 1994 13:10:40 GMT
  1721. Organization: France-Teaser
  1722.  
  1723. References: <askwersk-010494155542@el-2.media.mit.edu>
  1724.  
  1725. askwersk@athena.mit.edu (Adam Skwersky) writes:
  1726. > In article <2neija$i2@nntp.hut.fi>, heilei@colossus.cs.hut.fi (Heikki
  1727. > Leinonen) wrote:
  1728. > >. If I created the controls myself, I could
  1729. > >   add the useWFont constant to controls' definition values. But
  1730. > >   making the layout with ResEdit is SOOOOO easy...
  1731. > > 
  1732. > >   Anyone have any bright ideas on this one? 
  1733. > I have had a similar problem. I was trying to use the custom Connection
  1734. > Manager
  1735. > Setup routines that add DITL's to your dialog and you use the DITL's to
  1736. > setup up a certain tool. The items are all SUPPOSED to be in geneva 9, and
  1737. > when you call the toolbox command CMChoose() thats what you get. However
  1738. > if I were to add the DITL's to my OWN dialog, they all come out in
  1739. > Chicago 12. I thought about trying to go through each dialog item and
  1740. > changing its procID to procID+useWFont, but I could not even find the
  1741. > procID field in the ControlHandle record! I'm really lost with this as
  1742. > well,
  1743. > and I do not think it is a FAQ. Do any Mac gurus out there know how to go
  1744. > through a bunch of controls (dialog items) and change their fonts and
  1745. > sizes?
  1746. > Adam Skwersky
  1747. > askwersk@mit.edu
  1748. > adams@media.mit.edu
  1749.  
  1750.  I have EXACTLY the same problem and I'm managing to setup my custom
  1751.  connection manager setup dialog box.
  1752.  
  1753.  Well, it mostly works. I followed the example given in "IM: CTB", but
  1754.  before doing any update in the CTB part of the dialog box, or before
  1755.  calling any CTB function, I call a function of mine, which uses the
  1756.  Script Manager to set the current font attributes. It works for
  1757.  the control texts but not for the static or edit texts. The only
  1758.  way I've found to set the static & edit text font is to modify
  1759.  the SysFontFam & SysFontSiz low-memory variables but this is dirty
  1760.  and it also affects the menu bar (sometimes) and other window's title
  1761.  bar (always).
  1762.  
  1763.  Here is the function I use to set everything up before calling the
  1764.  connection manager:
  1765.  
  1766. static void SetCTBToolEnv(dialogInfoPtr infoP,DialogPtr theDialog)
  1767. {
  1768.   short script;
  1769.   unsigned long fnt;
  1770.  
  1771.   UseResFile(0);
  1772.   SetPort((GrafPtr)theDialog);
  1773.  
  1774.   fnt = ((long)geneva << 16L) | 9L;
  1775.   script = FontScript();
  1776.  
  1777.   SetScriptVariable(script,smScriptMonoFondSize,fnt);
  1778.   SetScriptVariable(script,smScriptPrefFondSize,fnt);
  1779.   SetScriptVariable(script,smScriptSmallFondSize,fnt);
  1780.   SetScriptVariable(script,smScriptSysFondSize,fnt);
  1781.   SetScriptVariable(script,smScriptAppFondSize,fnt);
  1782.  
  1783.   TextFont(geneva);
  1784.   TextSize(9);
  1785. }
  1786.  
  1787.  
  1788.  
  1789.   Well, this is a hack but it works. I still have to find how setup the
  1790.   Edit & Static Text font so it affects only my window.
  1791.  
  1792.   Anyway, those f****g bastards at Apple who have designed the CTB and
  1793.   implemented it should be thrown on a desert island. I can't imagine how
  1794.   they could do such a bad design and I don't understand why they decided
  1795.   to document only the easiest-to-use parts of their tools.
  1796.  
  1797.   Apple often makes beautiful software. This one was an exception. Ugly.
  1798.  
  1799.  
  1800.   Hope the code helps,
  1801.   Florent.
  1802.  
  1803. --
  1804.  
  1805.   Florent Pillet, freelance programmer.             ____/|
  1806.   Location: Paris, France.                          \ o O|
  1807.     E-Mail: tomcat@email.teaser.com                 =(_T_)=
  1808.                                                        U
  1809.  
  1810. +++++++++++++++++++++++++++
  1811.  
  1812. >From saseew@router.unx.sas.com (Ed Walker)
  1813. Date: Thu, 7 Apr 1994 13:31:45 GMT
  1814. Organization: SAS Institute Inc.
  1815.  
  1816.  
  1817. In article <1994Apr7.011549.21208@gallant.apple.com>, Jens Alfke <jens_alfke@powertalk.apple.com> writes:
  1818. >Heikki Leinonen, heilei@colossus.cs.hut.fi writes:
  1819. >>   is there a SIMPLE way to make *all* the texts
  1820. >>   (meaning static and edit texts, button and check box titles etc.)
  1821. >>   in my dialog something else than Chicago 12?
  1822. >
  1823.  
  1824. stuff deleted
  1825.  
  1826. >
  1827. >--Jens Alfke
  1828. >  jens_alfke@powertalk              Rebel girl, rebel girl,
  1829. >            .apple.com              Rebel girl you are the queen of my world
  1830.  
  1831. One thing that works for me is SetDAFont(n) before opening the dialog.
  1832. This only changes the font for static and edit text. Once your
  1833. dialog is open you can use SetDAFont(0) to restore the system font
  1834. for your other dialogs (like alerts) and it won't affect the opened
  1835. dialogs.
  1836.  
  1837. Ed                                               >'<                   
  1838.                                                 (o o)                  
  1839. +---------------------------------------------o0o-U-o0o---------------+
  1840. | EdWalker@aol.com    (home)     | It is impossible to make anything  |
  1841. | saseew@sas.mvs.com  (work)     | foolproof; fools are so ingenious. |
  1842. +---------------------------------------------oo0---0oo---------------+
  1843.  
  1844. +++++++++++++++++++++++++++
  1845.  
  1846. >From d88-jwa@hemul.nada.kth.se (Jon W‰tte)
  1847. Date: 7 Apr 1994 14:30:59 GMT
  1848. Organization: The Royal Institute of Technology
  1849.  
  1850. In <i7e3f.n3.t1ad56e60@email.teaser.com> tomcat@email.teaser.com ( Florent Pillet) writes:
  1851.  
  1852. >  Anyway, those f****g bastards at Apple who have designed the CTB and
  1853. >  implemented it should be thrown on a desert island. I can't imagine how
  1854. >  they could do such a bad design and I don't understand why they decided
  1855. >  to document only the easiest-to-use parts of their tools.
  1856.  
  1857. That obviously stands for your opinion, but I feel this is a rather
  1858. wonderful part of system software, and it solves a whole class of
  1859. problems which ANY other operating system simply ignores (at worst)
  1860. or doesn't really have any coherent support for (at best)
  1861.  
  1862. You are of course welcome to write your own code, but using such
  1863. language about Apple engineers will not improve your standing in
  1864. this newsgroup.
  1865.  
  1866. PS: There has been rumors about the CTB dying, but when I checked
  1867. with DTS, it seems those rumors are false. The CTB will not disappear
  1868. from the OS for the forseeable future, and it will "at some point in
  1869. time" "probably" become native; it's just no sense in doing so now,
  1870. since there are no native tools and the context switches would just
  1871. kill it.
  1872.  
  1873. -- 
  1874.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  1875.   "After I first used the Mac, I had a dream in which I would walk up to
  1876.    people, touch them, and they'd turn black. Then I could talk to them."
  1877.                      -- Anon
  1878.  
  1879. ---------------------------
  1880.  
  1881. >From hagst3+@pitt.edu (Herschel A Gelman)
  1882. Subject: Removing PowerPC code from a fat binary
  1883. Date: 1 Apr 94 22:15:40 GMT
  1884. Organization: University of Pittsburgh
  1885.  
  1886. Well, the subject line says most of it.  Is there an easy way to do this?  I'd
  1887. rather have the 680x0 code only, rather than waste already minimal hard drive
  1888. space.
  1889.  
  1890. I grabbed the fat version of JPEGView, and it seems like the 601 code is all in
  1891. the data fork.  Weird.  An older version I found had nothing in the data fork,
  1892. so it seems safe to just cut that out.  Which I haven't gotten around to doing
  1893. yet.  (I assume I'd have to change it to type text, then go in with a word
  1894. processor and select-all and delete -- is there an easier way??)
  1895.  
  1896. Is there anything in the resource fork?  How would a program distinguish
  1897. between data and PowerPC code, and how would I distinguish if I'm trying to
  1898. shorten the program like this?
  1899.  
  1900. I'd prefer E-mail responses...  gracias..
  1901.  
  1902.  
  1903. -- 
  1904. - -------------- Herschel Gelman ----------- hagst3+@pitt.edu -----------------
  1905.  
  1906. +++++++++++++++++++++++++++
  1907.  
  1908. >From d88-jwa@mumrik.nada.kth.se (Jon W‰tte)
  1909. Date: 2 Apr 1994 08:01:04 GMT
  1910. Organization: The Royal Institute of Technology
  1911.  
  1912. In <18996@blue.cis.pitt.edu> hagst3+@pitt.edu (Herschel A Gelman) writes:
  1913.  
  1914. >Well, the subject line says most of it.  Is there an easy way to do this?  I'd
  1915. >rather have the 680x0 code only, rather than waste already minimal hard drive
  1916. >space.
  1917.  
  1918. 1) Set the data fork length to 0 bytes
  1919. 2) Remove the cfrg resource
  1920.  
  1921. Done.
  1922. -- 
  1923.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  1924.   "It was, in fact, cool as all get-out.  Fortunately it was a little
  1925.    too late (historically speaking) to be groovy."
  1926.                      -- Dennis Pelton
  1927.  
  1928. +++++++++++++++++++++++++++
  1929.  
  1930. >From jackl@netcom.com (Jack Littleton)
  1931. Date: Mon, 4 Apr 1994 15:31:35 GMT
  1932. Organization: Law Offices of Buttafuoco, Bobbit and Harding
  1933.  
  1934. Jon W‰tte (d88-jwa@mumrik.nada.kth.se) wrote:
  1935. : 1) Set the data fork length to 0 bytes
  1936. : 2) Remove the cfrg resource
  1937.  
  1938. : Done.
  1939.  
  1940. To be really safe, I'd check the offset field of the cfrg resource before
  1941. doing this.  It is still possible, although not recommended, to store data
  1942. in the data fork of a fat binary.  The offset field in the cfrg tells the
  1943. CFM where the actual code starts (or other code fragments start).  If the
  1944. offset is zero, as it is for most apps I've seen, go ahead and zap the
  1945. data fork.
  1946. -- 
  1947. Jack Littleton                                               jackl@netcom.com
  1948. PowerPC and/or 68k Debugger Engineer                      Apple Computer, Inc.
  1949. (WARNING: Above title can change suddenly and without warning)
  1950.  
  1951.      ### This, and all other posts generated by myself, are in no ###
  1952.      ### way meant to be an official view of Apple Computer, Inc. ###
  1953.  
  1954. +++++++++++++++++++++++++++
  1955.  
  1956. >From jwbaxter@olympus.net (John W. Baxter)
  1957. Date: Mon, 04 Apr 1994 11:02:42 -0700
  1958. Organization: Internet for the Olympic Peninsula
  1959.  
  1960. In article <jacklCnqr4p.885@netcom.com>, jackl@netcom.com (Jack Littleton)
  1961. wrote:
  1962.  
  1963. > Jon Wtte (d88-jwa@mumrik.nada.kth.se) wrote:
  1964. > : 1) Set the data fork length to 0 bytes
  1965. > : 2) Remove the cfrg resource
  1966. > : Done.
  1967. > To be really safe, I'd check the offset field of the cfrg resource before
  1968. > doing this.  It is still possible, although not recommended, to store data
  1969. > in the data fork of a fat binary.  The offset field in the cfrg tells the
  1970. > CFM where the actual code starts (or other code fragments start).  If the
  1971. > offset is zero, as it is for most apps I've seen, go ahead and zap the
  1972. > data fork.
  1973.  
  1974. If you're going to go to the trouble of checking the offset field, also
  1975. check the length field...the fragment can be at offset zero with other
  1976. stuff after it.  If the length field is zero (kWholeFork, or some name like
  1977. that...fancy for 0), THEN the data fork is all [one] application fragment.
  1978.  
  1979. Or...try it "blind" and see whether the application objects.  [It may even
  1980. be worth it with JPEGView (the app in the original question):  almost 300K
  1981. out of the about 775K file is data fork.]
  1982. -- 
  1983. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1984.    jwbaxter@pt.olympus.net
  1985.  
  1986. +++++++++++++++++++++++++++
  1987.  
  1988. >From macguru@halcyon.com. (Allan Foster)
  1989. Date: 4 Apr 1994 21:26:40 GMT
  1990. Organization: Guru Inc
  1991.  
  1992. In article <jwbaxter-040494110242@ptpm004.olympus.net>
  1993. jwbaxter@olympus.net (John W. Baxter) writes:
  1994.  
  1995. > In article <jacklCnqr4p.885@netcom.com>, jackl@netcom.com (Jack Littleton)
  1996. > wrote:
  1997. > > Jon Wtte (d88-jwa@mumrik.nada.kth.se) wrote:
  1998. > > : 1) Set the data fork length to 0 bytes
  1999. > > : 2) Remove the cfrg resource
  2000. > > 
  2001. > > : Done.
  2002. > > 
  2003. > > To be really safe, I'd check the offset field of the cfrg resource before
  2004. > > doing this.  It is still possible, although not recommended, to store data
  2005. > > in the data fork of a fat binary.  The offset field in the cfrg tells the
  2006. > > CFM where the actual code starts (or other code fragments start).  If the
  2007. > > offset is zero, as it is for most apps I've seen, go ahead and zap the
  2008. > > data fork.
  2009. > If you're going to go to the trouble of checking the offset field, also
  2010. > check the length field...the fragment can be at offset zero with other
  2011. > stuff after it.  If the length field is zero (kWholeFork, or some name like
  2012. > that...fancy for 0), THEN the data fork is all [one] application fragment.
  2013. > Or...try it "blind" and see whether the application objects.  [It may even
  2014. > be worth it with JPEGView (the app in the original question):  almost 300K
  2015. > out of the about 775K file is data fork.]
  2016. > -- 
  2017.  
  2018. If you REALLY want to do the right thing,  then you may want to look to
  2019. see if there are any other cfrg resources in the resource fork.  Since
  2020. there is nothing stopping anyone from having MULTIPLE containers in the
  2021. data fork, you may have to update the other cfrg resources if you
  2022. delete stuff.....
  2023.  
  2024. And nothing says it has to start at 0 either!
  2025. - --------------------------------------------------------
  2026. I am responsible for what I say and do. -- Allan Foster --
  2027.  
  2028. +++++++++++++++++++++++++++
  2029.  
  2030. >From troy@i-link.com (Troy Gaul)
  2031. Date: 4 Apr 1994 23:43:30 -0500
  2032. Organization: I-Link, Ltd., Des Moines, IA, USA - 515/255-2754
  2033.  
  2034. In article <2nq0mg$t31@nwfocus.wa.com>,
  2035. Allan Foster <macguru@halcyon.com.> wrote:
  2036. >In article <jwbaxter-040494110242@ptpm004.olympus.net>
  2037. >jwbaxter@olympus.net (John W. Baxter) writes:
  2038. >
  2039. >> In article <jacklCnqr4p.885@netcom.com>, jackl@netcom.com (Jack Littleton)
  2040. >> wrote:
  2041. >> 
  2042. >> > Jon Wtte (d88-jwa@mumrik.nada.kth.se) wrote:
  2043. >> > : 1) Set the data fork length to 0 bytes
  2044. >> > : 2) Remove the cfrg resource
  2045. >> > 
  2046. >> > : Done.
  2047. >> > 
  2048. >> > To be really safe, I'd check the offset field of the cfrg resource before
  2049. >> > doing this.  It is still possible, although not recommended, to store data
  2050. >> > in the data fork of a fat binary.  The offset field in the cfrg tells the
  2051. >> > CFM where the actual code starts (or other code fragments start).  If the
  2052. >> > offset is zero, as it is for most apps I've seen, go ahead and zap the
  2053. >> > data fork.
  2054. >> 
  2055. >> If you're going to go to the trouble of checking the offset field, also
  2056. >> check the length field...the fragment can be at offset zero with other
  2057. >> stuff after it.  If the length field is zero (kWholeFork, or some name like
  2058. >> that...fancy for 0), THEN the data fork is all [one] application fragment.
  2059. >> 
  2060. >> Or...try it "blind" and see whether the application objects.  [It may even
  2061. >> be worth it with JPEGView (the app in the original question):  almost 300K
  2062. >> out of the about 775K file is data fork.]
  2063. >> -- 
  2064. >
  2065. >If you REALLY want to do the right thing,  then you may want to look to
  2066. >see if there are any other cfrg resources in the resource fork.  Since
  2067. >there is nothing stopping anyone from having MULTIPLE containers in the
  2068. >data fork, you may have to update the other cfrg resources if you
  2069. >delete stuff.....
  2070.  
  2071. There shouldn't be more than one 'cfrg' resource.  Only the one with ID 0
  2072. is looked at, but it can describe multiple code fragments.
  2073.  
  2074. You would also want to check the code's type, as it might not be for the
  2075. PowerPC ('pwpc').  It could (in the future) be for the 68K or
  2076. theoretically some other processor.
  2077.  
  2078. Theoretically, there can be data after code, multiple codes (multiple
  2079. fragments for one processor or fragments for different processors -- or 
  2080. both), and there could even be multiple datas interspersed between codes.
  2081.  
  2082. _troy
  2083. -- 
  2084. //////// //////   Troy Gaul                            t-gaul@i-link.com   //
  2085.   //    //       I-Link, Ltd.                                             //
  2086.  //    //  //   "Iungo ergo sum." (I-Link, therefore I am.)              //
  2087. //    ////// __________________________________________________________ //
  2088.  
  2089. +++++++++++++++++++++++++++
  2090.  
  2091. >From johnson@wrs.com (David Johnson)
  2092. Date: Fri, 8 Apr 1994 01:35:09 GMT
  2093. Organization: Wind River Systems, Inc.
  2094.  
  2095. jackl@netcom.com (Jack Littleton) writes:
  2096.  
  2097. >Jon W‰tte (d88-jwa@mumrik.nada.kth.se) wrote:
  2098. >: 1) Set the data fork length to 0 bytes
  2099. >: 2) Remove the cfrg resource
  2100.  
  2101. >: Done.
  2102.  
  2103. >To be really safe, I'd check the offset field of the cfrg resource before
  2104. >doing this.  It is still possible, although not recommended, to store data
  2105. >in the data fork of a fat binary.  The offset field in the cfrg tells the
  2106. >CFM where the actual code starts (or other code fragments start).  If the
  2107. >offset is zero, as it is for most apps I've seen, go ahead and zap the
  2108. >data fork.
  2109.  
  2110. If you want to just shit-can the data fork and see if the app runs, use
  2111. one of the the apps made for munging the registration info that a lot
  2112. of apps store in the data fork.  A little more elegent than using a
  2113. word-processor.
  2114.  
  2115. Let's see what we have here...
  2116.  
  2117. /folk/johnson/Misc/Umich/mac.archive.umich.edu.gz    %71.2
  2118. /mac/util/diskfile/anonymity1.2.cpt.hqx
  2119.   34    12/20/92    BinHex4.0,Compact1.34
  2120.  
  2121.    Remove the personalization info from programs (like Word and Excel)
  2122.    that store the info (and ONLY the info) in the data fork.
  2123.  
  2124.  
  2125. Yup, that otta do it :-)
  2126.  
  2127. --DAVE (johnson@wrs.com)
  2128.  
  2129. "And now, a man who faces his destiny at FULL THROTTLE...  Its David Letterman!"
  2130.  
  2131.                                    (c)1993 CBS
  2132.  
  2133. ---------------------------
  2134.  
  2135. >From Vik_Rubenfeld@lamg.com (Vik Rubenfeld)
  2136. Subject: Roman Numerals
  2137. Date: 05 Apr 1994 00:21:15 -0000
  2138. Organization: (none)
  2139.  
  2140. Does anybody have an algorithm for translating an integer into a string that
  2141. contains its Roman Numeral equivalent? Thanks in advance.
  2142.  
  2143. +++++++++++++++++++++++++++
  2144.  
  2145. >From Vik_Rubenfeld@lamg.com (Vik Rubenfeld)
  2146. Date: 06 Apr 1994 10:20:10 -0000
  2147. Organization: (none)
  2148.  
  2149. Thanks for the extremely cool algorithm.
  2150.  
  2151. +++++++++++++++++++++++++++
  2152.  
  2153. >From Vik_Rubenfeld@lamg.com (Vik Rubenfeld)
  2154. Date: 07 Apr 1994 11:32:15 -0000
  2155. Organization: (none)
  2156.  
  2157.  
  2158. Thanks for your excellent procedure, ArabicToRoman. It was also a good
  2159. excercise for me to use in becoming more familiar with C, because I
  2160. translated it from C to Pascal. In case you'd like to see it, and in case
  2161. others would like a Pascal version, here's what it looks like in Pascal.
  2162.  
  2163.  
  2164. procedure ArabicToRoman (arab: integer;
  2165.        var Rom: DecStr);
  2166.   const
  2167.    nFives = 3;
  2168.    nOnes = 4;
  2169.  
  2170.   var
  2171.    reverse: integer;{ stores digits in reverse order (6533 -> 3356) }
  2172.    mag: integer;{ magnitude of the arabic number (6533 -> 3   ) }
  2173.    digit: integer;{ current digit being processed                 }
  2174.  
  2175.    Fives, Ones: DecStr;
  2176.  begin
  2177.   reverse := 0;
  2178.   mag := -1;
  2179.   Rom := '';
  2180.  
  2181.   Fives := 'vld';
  2182.   Ones := 'ixcm';
  2183.  
  2184.   while (arab > 0) do
  2185.    begin
  2186.     reverse := reverse * 10;
  2187.     reverse := reverse + (arab mod 10);
  2188.     arab := arab div 10;
  2189.     mag := mag + 1;
  2190.    end;
  2191.  
  2192.   while reverse > 0 do
  2193.    begin
  2194.     digit := reverse mod 10;
  2195.     reverse := reverse div 10;
  2196.  
  2197.     if (((mag = nFives) & (digit > 3)) | ((mag = nOnes) & (digit <> 5)) |
  2198. ((digit = 9) & (mag = nOnes - 1))) then
  2199.      begin
  2200.       Rom := 'Cannot Convert';
  2201.       exit(ArabicToRoman);
  2202.      end;
  2203.  
  2204.     case digit of
  2205.      3: 
  2206.       begin
  2207.        rom := concat(rom, ones[mag + 1]);
  2208.        rom := concat(rom, ones[mag + 1]);
  2209.        rom := concat(rom, ones[mag + 1]);
  2210.       end;
  2211.      2: 
  2212.       begin
  2213.        rom := concat(rom, ones[mag + 1]);
  2214.        rom := concat(rom, ones[mag + 1]);
  2215.       end;
  2216.      1: 
  2217.       rom := concat(rom, ones[mag + 1]);
  2218.  
  2219.      4: 
  2220.       begin
  2221.        rom := concat(rom, ones[mag + 1]);
  2222.        rom := concat(rom, fives[mag + 1]);
  2223.       end;
  2224.  
  2225.      5: 
  2226.       rom := concat(rom, fives[mag + 1]);
  2227.  
  2228.      6: 
  2229.       begin
  2230.        rom := concat(rom, fives[mag + 1]);
  2231.        rom := concat(rom, ones[mag + 1]);
  2232.       end;
  2233.  
  2234.      7: 
  2235.       begin
  2236.        rom := concat(rom, fives[mag + 1]);
  2237.        rom := concat(rom, ones[mag + 1]);
  2238.        rom := concat(rom, ones[mag + 1]);
  2239.       end;
  2240.  
  2241.      8: 
  2242.       begin
  2243.        rom := concat(rom, fives[mag + 1]);
  2244.        rom := concat(rom, ones[mag + 1]);
  2245.        rom := concat(rom, ones[mag + 1]);
  2246.        rom := concat(rom, ones[mag + 1]);
  2247.       end;
  2248.  
  2249.      9: 
  2250.       begin
  2251.        rom := concat(rom, ones[mag + 1]);
  2252.        rom := concat(rom, ones[mag + 2]);
  2253.       end;
  2254.  
  2255.      otherwise
  2256.       ;
  2257.     end; {case}
  2258.     mag := mag - 1;
  2259.    end; {while}
  2260.  end;
  2261.  
  2262.  
  2263.  
  2264.  
  2265. +++++++++++++++++++++++++++
  2266.  
  2267. >From Vik_Rubenfeld@lamg.com (Vik Rubenfeld)
  2268. Date: 08 Apr 1994 21:51:07 -0000
  2269. Organization: (none)
  2270.  
  2271. CMG> Hi there! I have some Pascal code that I wrote for a program that
  2272. CMG> converts Decimal, hexadecimal, etc. to Roman Numerals and vice
  2273. CMG> versa... I might be able to dig it up : ) 
  2274. CMG> 
  2275. CMG> What kind of program are you writing?
  2276.  
  2277. Thanks! Sure, I'd like to see it. I've adapted a C routine provided by Mike
  2278. Mayer, and it's working fine, but the hex part of your code might be neat to
  2279. see. 
  2280.  
  2281. It's a program that tabulates Market Research data. It's the basis of a
  2282. business I operate. I wanted to use Roman Numerals for the page numbers in
  2283. the table of contents.
  2284.  
  2285. ---------------------------
  2286.  
  2287. >From armitage@marksmac.demon.co.uk (Mark Armitage)
  2288. Subject: SCSI Drivers
  2289. Date: Thu, 7 Apr 1994 12:54:12 GMT
  2290. Organization: Poor,  but trying...
  2291.  
  2292. Help,
  2293.  
  2294. I have a non-apple SCSI drive which requires a SCSI START command to be
  2295. sent to it!  (Apparently the drive doesn't acually start spinning until
  2296. this command is received).
  2297.  
  2298. Can anyone point me in the direction of a utility/init or piece of code
  2299. that can perform this function?
  2300.  
  2301. Thanks,
  2302.  
  2303. Mark.
  2304.  
  2305. armitage@marksmac.demon.co.uk
  2306.  
  2307. +++++++++++++++++++++++++++
  2308.  
  2309. >From lankton@spot.Colorado.EDU (LANKTON MARK)
  2310. Date: Fri, 8 Apr 1994 13:47:55 GMT
  2311. Organization: University of Colorado, Boulder
  2312.  
  2313. armitage@marksmac.demon.co.uk (Mark Armitage) writes:
  2314.  
  2315. >Help,
  2316.  
  2317. >I have a non-apple SCSI drive which requires a SCSI START command to be
  2318. >sent to it!  (Apparently the drive doesn't acually start spinning until
  2319. >this command is received).
  2320.  
  2321. >Can anyone point me in the direction of a utility/init or piece of code
  2322. >that can perform this function?
  2323.  
  2324. >Thanks,
  2325.  
  2326. >Mark.
  2327.  
  2328. >armitage@marksmac.demon.co.uk
  2329.  
  2330. Try this:
  2331.  
  2332.  
  2333. #define     kStartStopUnitCmd    0x1B
  2334. #define     kStartCode            0x01
  2335. #define     kStopCode            0x00
  2336. SpinUp(short targetID)
  2337. {
  2338.     short             theResult;
  2339.     unsigned char    theCommand[6];
  2340.     sensePage        returnedSense;    
  2341.     short            numTries = 0;
  2342.     Boolean            gotBus = false;
  2343.     int                waitTime = 100;    /*or so...*/
  2344.     short            returnedStatus = 0;
  2345.     short            returnedMessage = 0;
  2346.         
  2347.     
  2348.     theCommand[0] = kStartStopUnitCmd;
  2349.     theCommand[1] = 0x01;    /*Don't wait for reply on command */
  2350.     theCommand[2] = 0;
  2351.     theCommand[3] = 0;
  2352.     theCommand[4] = kStartCode;
  2353.     theCommand[5] = 0;
  2354.     
  2355.     do
  2356.         {
  2357.         numTries++;
  2358.         theResult = SCSIGet();
  2359.         if(theResult == noErr)
  2360.             {
  2361.             theResult = SCSISelect(targetID);
  2362.             if(theResult == noErr)
  2363.                 gotBus = true;
  2364.             
  2365.             }            
  2366.         }    
  2367.         while((numTries <= kMaxSelectTries) && (!gotBus));
  2368.         
  2369.     if((numTries >= kMaxSelectTries) || !gotBus)
  2370.         {
  2371.         printf("SCSI device selection failed on ID = %d",targetID);
  2372.         return;
  2373.         }
  2374.         
  2375.     if(gotBus)
  2376.         {
  2377.         theResult = SCSICmd((char *)theCommand,6);
  2378.         theResult = SCSIComplete(&returnedStatus,&returnedMessage,waitTime);
  2379.         }
  2380.         
  2381.     /*Check returnedStatus for errors
  2382.  
  2383. }    
  2384.  
  2385. Mark Lankton (lankton@spot.colorado.edu)
  2386. Laboratory for Atmospheric and Space Physics
  2387. University of Colorado
  2388.  
  2389. ---------------------------
  2390.  
  2391. End of C.S.M.P. Digest
  2392. **********************
  2393.  
  2394.  
  2395.